2020-06-16 03:41:31 +12:00
|
|
|
export const FIELDS = {
|
2020-08-08 03:13:57 +12:00
|
|
|
STRING: {
|
2020-09-30 06:27:35 +13:00
|
|
|
name: "Text",
|
2020-06-17 07:29:18 +12:00
|
|
|
type: "string",
|
|
|
|
constraints: {
|
2020-06-16 03:41:31 +12:00
|
|
|
type: "string",
|
2020-06-17 07:29:18 +12:00
|
|
|
length: {},
|
2020-10-06 05:28:23 +13:00
|
|
|
presence: false,
|
2020-06-16 03:41:31 +12:00
|
|
|
},
|
|
|
|
},
|
2020-12-04 03:03:17 +13:00
|
|
|
LONGFORM: {
|
|
|
|
name: "Long Form Text",
|
|
|
|
type: "longform",
|
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
length: {},
|
|
|
|
presence: false,
|
|
|
|
},
|
|
|
|
},
|
2020-09-30 06:27:35 +13:00
|
|
|
OPTIONS: {
|
|
|
|
name: "Options",
|
|
|
|
type: "options",
|
|
|
|
constraints: {
|
|
|
|
type: "string",
|
2020-10-12 08:42:30 +13:00
|
|
|
presence: false,
|
2021-08-20 03:54:44 +12:00
|
|
|
inclusion: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ARRAY: {
|
|
|
|
name: "List",
|
|
|
|
type: "array",
|
|
|
|
constraints: {
|
|
|
|
type: "array",
|
|
|
|
presence: false,
|
2020-09-30 06:27:35 +13:00
|
|
|
inclusion: [],
|
|
|
|
},
|
|
|
|
},
|
2020-06-16 03:41:31 +12:00
|
|
|
NUMBER: {
|
|
|
|
name: "Number",
|
2020-06-17 07:29:18 +12:00
|
|
|
type: "number",
|
|
|
|
constraints: {
|
2020-06-16 03:41:31 +12:00
|
|
|
type: "number",
|
2020-10-06 05:28:23 +13:00
|
|
|
presence: false,
|
2020-08-20 22:19:13 +12:00
|
|
|
numericality: { greaterThanOrEqualTo: "", lessThanOrEqualTo: "" },
|
2020-06-16 03:41:31 +12:00
|
|
|
},
|
|
|
|
},
|
|
|
|
BOOLEAN: {
|
2021-02-23 22:38:24 +13:00
|
|
|
name: "Boolean",
|
2020-06-17 07:29:18 +12:00
|
|
|
type: "boolean",
|
|
|
|
constraints: {
|
2020-06-16 03:41:31 +12:00
|
|
|
type: "boolean",
|
2020-10-06 05:28:23 +13:00
|
|
|
presence: false,
|
2020-06-16 03:41:31 +12:00
|
|
|
},
|
|
|
|
},
|
2020-09-09 05:03:41 +12:00
|
|
|
DATETIME: {
|
|
|
|
name: "Date/Time",
|
|
|
|
type: "datetime",
|
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
length: {},
|
2020-10-06 05:28:23 +13:00
|
|
|
presence: false,
|
2020-09-09 05:03:41 +12:00
|
|
|
datetime: {
|
|
|
|
latest: "",
|
|
|
|
earliest: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-09-12 02:09:56 +12:00
|
|
|
ATTACHMENT: {
|
|
|
|
name: "Attachment",
|
|
|
|
type: "attachment",
|
|
|
|
constraints: {
|
|
|
|
type: "array",
|
2020-10-06 05:28:23 +13:00
|
|
|
presence: false,
|
2020-09-12 02:09:56 +12:00
|
|
|
},
|
|
|
|
},
|
2020-09-30 06:27:35 +13:00
|
|
|
LINK: {
|
|
|
|
name: "Relationship",
|
|
|
|
type: "link",
|
|
|
|
constraints: {
|
|
|
|
type: "array",
|
2020-10-12 08:42:30 +13:00
|
|
|
presence: false,
|
2020-09-30 06:27:35 +13:00
|
|
|
},
|
2021-02-16 08:59:49 +13:00
|
|
|
},
|
2021-04-30 06:06:58 +12:00
|
|
|
FORMULA: {
|
|
|
|
name: "Formula",
|
|
|
|
type: "formula",
|
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
presence: false,
|
|
|
|
},
|
|
|
|
},
|
2021-02-16 06:47:14 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
export const AUTO_COLUMN_SUB_TYPES = {
|
2021-02-16 08:59:30 +13:00
|
|
|
AUTO_ID: "autoID",
|
2021-02-16 06:47:14 +13:00
|
|
|
CREATED_BY: "createdBy",
|
|
|
|
CREATED_AT: "createdAt",
|
|
|
|
UPDATED_BY: "updatedBy",
|
|
|
|
UPDATED_AT: "updatedAt",
|
2021-02-16 08:59:30 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
export const AUTO_COLUMN_DISPLAY_NAMES = {
|
|
|
|
AUTO_ID: "Auto ID",
|
|
|
|
CREATED_BY: "Created By",
|
|
|
|
CREATED_AT: "Created At",
|
|
|
|
UPDATED_BY: "Updated By",
|
|
|
|
UPDATED_AT: "Updated At",
|
2020-06-16 03:41:31 +12:00
|
|
|
}
|
2020-09-17 23:45:28 +12:00
|
|
|
|
|
|
|
export const FILE_TYPES = {
|
|
|
|
IMAGE: ["png", "tiff", "gif", "raw", "jpg", "jpeg"],
|
|
|
|
CODE: ["js", "rs", "py", "java", "rb", "hs", "yml"],
|
2020-09-18 03:36:39 +12:00
|
|
|
DOCUMENT: ["odf", "docx", "doc", "pdf", "csv"],
|
|
|
|
}
|
2021-01-27 00:07:30 +13:00
|
|
|
|
|
|
|
export const HostingTypes = {
|
|
|
|
CLOUD: "cloud",
|
|
|
|
SELF: "self",
|
|
|
|
}
|
2021-02-11 11:23:27 +13:00
|
|
|
|
|
|
|
export const Roles = {
|
|
|
|
ADMIN: "ADMIN",
|
|
|
|
POWER: "POWER",
|
|
|
|
BASIC: "BASIC",
|
|
|
|
PUBLIC: "PUBLIC",
|
|
|
|
BUILDER: "BUILDER",
|
|
|
|
}
|
2021-02-16 06:47:14 +13:00
|
|
|
|
|
|
|
export function isAutoColumnUserRelationship(subtype) {
|
2021-02-16 08:59:49 +13:00
|
|
|
return (
|
|
|
|
subtype === AUTO_COLUMN_SUB_TYPES.CREATED_BY ||
|
2021-02-16 06:47:14 +13:00
|
|
|
subtype === AUTO_COLUMN_SUB_TYPES.UPDATED_BY
|
2021-02-16 08:59:49 +13:00
|
|
|
)
|
2021-02-16 06:47:14 +13:00
|
|
|
}
|
2021-03-02 06:06:08 +13:00
|
|
|
|
|
|
|
export const RelationshipTypes = {
|
|
|
|
MANY_TO_MANY: "many-to-many",
|
|
|
|
ONE_TO_MANY: "one-to-many",
|
|
|
|
MANY_TO_ONE: "many-to-one",
|
|
|
|
}
|