2020-06-15 17:41:31 +02:00
|
|
|
export const FIELDS = {
|
2020-08-07 17:13:57 +02:00
|
|
|
STRING: {
|
2020-09-29 19:27:35 +02:00
|
|
|
name: "Text",
|
2020-06-16 21:29:18 +02:00
|
|
|
type: "string",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Text",
|
2020-06-16 21:29:18 +02:00
|
|
|
constraints: {
|
2020-06-15 17:41:31 +02:00
|
|
|
type: "string",
|
2020-06-16 21:29:18 +02:00
|
|
|
length: {},
|
2020-10-05 18:28:23 +02:00
|
|
|
presence: false,
|
2020-06-15 17:41:31 +02:00
|
|
|
},
|
|
|
|
},
|
2022-10-07 12:00:25 +02:00
|
|
|
BARCODEQR: {
|
|
|
|
name: "Barcode/QR",
|
|
|
|
type: "barcodeqr",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Camera",
|
2022-10-05 10:28:07 +02:00
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
length: {},
|
|
|
|
presence: false,
|
|
|
|
},
|
|
|
|
},
|
2020-12-03 15:03:17 +01:00
|
|
|
LONGFORM: {
|
|
|
|
name: "Long Form Text",
|
|
|
|
type: "longform",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "TextAlignLeft",
|
2020-12-03 15:03:17 +01:00
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
length: {},
|
|
|
|
presence: false,
|
|
|
|
},
|
|
|
|
},
|
2020-09-29 19:27:35 +02:00
|
|
|
OPTIONS: {
|
|
|
|
name: "Options",
|
|
|
|
type: "options",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Dropdown",
|
2020-09-29 19:27:35 +02:00
|
|
|
constraints: {
|
|
|
|
type: "string",
|
2020-10-11 21:42:30 +02:00
|
|
|
presence: false,
|
2021-08-19 17:54:44 +02:00
|
|
|
inclusion: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ARRAY: {
|
2021-08-26 15:04:18 +02:00
|
|
|
name: "Multi-select",
|
2021-08-19 17:54:44 +02:00
|
|
|
type: "array",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Duplicate",
|
2021-08-19 17:54:44 +02:00
|
|
|
constraints: {
|
|
|
|
type: "array",
|
|
|
|
presence: false,
|
2020-09-29 19:27:35 +02:00
|
|
|
inclusion: [],
|
|
|
|
},
|
|
|
|
},
|
2020-06-15 17:41:31 +02:00
|
|
|
NUMBER: {
|
|
|
|
name: "Number",
|
2020-06-16 21:29:18 +02:00
|
|
|
type: "number",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "123",
|
2020-06-16 21:29:18 +02:00
|
|
|
constraints: {
|
2020-06-15 17:41:31 +02:00
|
|
|
type: "number",
|
2020-10-05 18:28:23 +02:00
|
|
|
presence: false,
|
2020-08-20 12:19:13 +02:00
|
|
|
numericality: { greaterThanOrEqualTo: "", lessThanOrEqualTo: "" },
|
2020-06-15 17:41:31 +02:00
|
|
|
},
|
|
|
|
},
|
2023-07-07 16:11:41 +02:00
|
|
|
BIGINT: {
|
|
|
|
name: "BigInt",
|
|
|
|
type: "bigint",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "TagBold",
|
2023-07-07 16:11:41 +02:00
|
|
|
},
|
2020-06-15 17:41:31 +02:00
|
|
|
BOOLEAN: {
|
2021-02-23 10:38:24 +01:00
|
|
|
name: "Boolean",
|
2020-06-16 21:29:18 +02:00
|
|
|
type: "boolean",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Boolean",
|
2020-06-16 21:29:18 +02:00
|
|
|
constraints: {
|
2020-06-15 17:41:31 +02:00
|
|
|
type: "boolean",
|
2020-10-05 18:28:23 +02:00
|
|
|
presence: false,
|
2020-06-15 17:41:31 +02:00
|
|
|
},
|
|
|
|
},
|
2020-09-08 19:03:41 +02:00
|
|
|
DATETIME: {
|
|
|
|
name: "Date/Time",
|
|
|
|
type: "datetime",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Calendar",
|
2020-09-08 19:03:41 +02:00
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
length: {},
|
2020-10-05 18:28:23 +02:00
|
|
|
presence: false,
|
2020-09-08 19:03:41 +02:00
|
|
|
datetime: {
|
|
|
|
latest: "",
|
|
|
|
earliest: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-09-11 16:09:56 +02:00
|
|
|
ATTACHMENT: {
|
|
|
|
name: "Attachment",
|
|
|
|
type: "attachment",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Folder",
|
2020-09-11 16:09:56 +02:00
|
|
|
constraints: {
|
|
|
|
type: "array",
|
2020-10-05 18:28:23 +02:00
|
|
|
presence: false,
|
2020-09-11 16:09:56 +02:00
|
|
|
},
|
|
|
|
},
|
2020-09-29 19:27:35 +02:00
|
|
|
LINK: {
|
|
|
|
name: "Relationship",
|
|
|
|
type: "link",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Link",
|
2020-09-29 19:27:35 +02:00
|
|
|
constraints: {
|
|
|
|
type: "array",
|
2020-10-11 21:42:30 +02:00
|
|
|
presence: false,
|
2020-09-29 19:27:35 +02:00
|
|
|
},
|
2021-02-15 20:59:49 +01:00
|
|
|
},
|
2021-04-29 20:06:58 +02:00
|
|
|
FORMULA: {
|
|
|
|
name: "Formula",
|
|
|
|
type: "formula",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Calculator",
|
2022-02-21 16:01:42 +01:00
|
|
|
constraints: {},
|
2021-04-29 20:06:58 +02:00
|
|
|
},
|
2021-11-23 19:20:12 +01:00
|
|
|
JSON: {
|
2021-12-10 16:26:43 +01:00
|
|
|
name: "JSON",
|
2021-11-23 19:20:12 +01:00
|
|
|
type: "json",
|
2023-07-31 16:28:11 +02:00
|
|
|
icon: "Brackets",
|
2021-11-23 19:20:12 +01:00
|
|
|
constraints: {
|
|
|
|
type: "object",
|
|
|
|
presence: false,
|
|
|
|
},
|
|
|
|
},
|
2021-02-15 18:47:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export const AUTO_COLUMN_SUB_TYPES = {
|
2021-02-15 20:59:30 +01:00
|
|
|
AUTO_ID: "autoID",
|
2021-02-15 18:47:14 +01:00
|
|
|
CREATED_BY: "createdBy",
|
|
|
|
CREATED_AT: "createdAt",
|
|
|
|
UPDATED_BY: "updatedBy",
|
|
|
|
UPDATED_AT: "updatedAt",
|
2021-02-15 20:59:30 +01: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-15 17:41:31 +02:00
|
|
|
}
|
2020-09-17 13:45:28 +02:00
|
|
|
|
|
|
|
export const FILE_TYPES = {
|
|
|
|
IMAGE: ["png", "tiff", "gif", "raw", "jpg", "jpeg"],
|
|
|
|
CODE: ["js", "rs", "py", "java", "rb", "hs", "yml"],
|
2020-09-17 17:36:39 +02:00
|
|
|
DOCUMENT: ["odf", "docx", "doc", "pdf", "csv"],
|
|
|
|
}
|
2021-01-26 12:07:30 +01:00
|
|
|
|
|
|
|
export const HostingTypes = {
|
|
|
|
CLOUD: "cloud",
|
|
|
|
SELF: "self",
|
|
|
|
}
|
2021-02-10 23:23:27 +01:00
|
|
|
|
|
|
|
export const Roles = {
|
|
|
|
ADMIN: "ADMIN",
|
|
|
|
POWER: "POWER",
|
|
|
|
BASIC: "BASIC",
|
|
|
|
PUBLIC: "PUBLIC",
|
|
|
|
BUILDER: "BUILDER",
|
|
|
|
}
|
2021-02-15 18:47:14 +01:00
|
|
|
|
|
|
|
export function isAutoColumnUserRelationship(subtype) {
|
2021-02-15 20:59:49 +01:00
|
|
|
return (
|
|
|
|
subtype === AUTO_COLUMN_SUB_TYPES.CREATED_BY ||
|
2021-02-15 18:47:14 +01:00
|
|
|
subtype === AUTO_COLUMN_SUB_TYPES.UPDATED_BY
|
2021-02-15 20:59:49 +01:00
|
|
|
)
|
2021-02-15 18:47:14 +01:00
|
|
|
}
|
2021-03-01 18:06:08 +01:00
|
|
|
|
2023-07-21 13:57:47 +02:00
|
|
|
export const RelationshipType = {
|
2021-03-01 18:06:08 +01:00
|
|
|
MANY_TO_MANY: "many-to-many",
|
|
|
|
ONE_TO_MANY: "one-to-many",
|
|
|
|
MANY_TO_ONE: "many-to-one",
|
|
|
|
}
|
2021-11-10 16:01:44 +01:00
|
|
|
|
2022-04-27 17:29:03 +02:00
|
|
|
export const ALLOWABLE_STRING_OPTIONS = [
|
|
|
|
FIELDS.STRING,
|
|
|
|
FIELDS.OPTIONS,
|
|
|
|
FIELDS.LONGFORM,
|
2022-10-07 12:00:25 +02:00
|
|
|
FIELDS.BARCODEQR,
|
2022-04-27 17:29:03 +02:00
|
|
|
]
|
2021-11-10 16:01:44 +01:00
|
|
|
export const ALLOWABLE_STRING_TYPES = ALLOWABLE_STRING_OPTIONS.map(
|
|
|
|
opt => opt.type
|
|
|
|
)
|
|
|
|
|
|
|
|
export const ALLOWABLE_NUMBER_OPTIONS = [FIELDS.NUMBER, FIELDS.BOOLEAN]
|
|
|
|
export const ALLOWABLE_NUMBER_TYPES = ALLOWABLE_NUMBER_OPTIONS.map(
|
|
|
|
opt => opt.type
|
|
|
|
)
|
|
|
|
|
2022-01-26 19:50:13 +01:00
|
|
|
export const SWITCHABLE_TYPES = [
|
|
|
|
...ALLOWABLE_STRING_TYPES,
|
|
|
|
...ALLOWABLE_NUMBER_TYPES,
|
|
|
|
]
|
2021-12-06 18:39:51 +01:00
|
|
|
|
2022-11-15 18:03:35 +01:00
|
|
|
export const BUDIBASE_INTERNAL_DB_ID = "bb_internal"
|
2022-11-28 18:25:10 +01:00
|
|
|
export const DEFAULT_BB_DATASOURCE_ID = "datasource_internal_bb_default"
|
2022-11-15 18:03:35 +01:00
|
|
|
export const BUDIBASE_DATASOURCE_TYPE = "budibase"
|
2022-11-23 18:12:23 +01:00
|
|
|
export const DB_TYPE_INTERNAL = "internal"
|
|
|
|
export const DB_TYPE_EXTERNAL = "external"
|
2022-08-10 17:27:53 +02:00
|
|
|
|
2021-12-06 18:39:51 +01:00
|
|
|
export const IntegrationTypes = {
|
|
|
|
POSTGRES: "POSTGRES",
|
|
|
|
MONGODB: "MONGODB",
|
|
|
|
COUCHDB: "COUCHDB",
|
|
|
|
S3: "S3",
|
|
|
|
MYSQL: "MYSQL",
|
|
|
|
REST: "REST",
|
|
|
|
DYNAMODB: "DYNAMODB",
|
|
|
|
ELASTICSEARCH: "ELASTICSEARCH",
|
|
|
|
SQL_SERVER: "SQL_SERVER",
|
|
|
|
AIRTABLE: "AIRTABLE",
|
|
|
|
ARANGODB: "ARANGODB",
|
|
|
|
ORACLE: "ORACLE",
|
|
|
|
INTERNAL: "INTERNAL",
|
2022-01-15 19:28:04 +01:00
|
|
|
GOOGLE_SHEETS: "GOOGLE_SHEETS",
|
2022-06-08 13:05:29 +02:00
|
|
|
FIRESTORE: "FIRESTORE",
|
2022-03-31 11:56:16 +02:00
|
|
|
REDIS: "REDIS",
|
2022-05-30 22:13:45 +02:00
|
|
|
SNOWFLAKE: "SNOWFLAKE",
|
2021-12-06 18:39:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export const IntegrationNames = {
|
|
|
|
[IntegrationTypes.POSTGRES]: "PostgreSQL",
|
|
|
|
[IntegrationTypes.MONGODB]: "MongoDB",
|
|
|
|
[IntegrationTypes.COUCHDB]: "CouchDB",
|
|
|
|
[IntegrationTypes.S3]: "S3",
|
|
|
|
[IntegrationTypes.MYSQL]: "MySQL",
|
|
|
|
[IntegrationTypes.REST]: "REST",
|
|
|
|
[IntegrationTypes.DYNAMODB]: "DynamoDB",
|
|
|
|
[IntegrationTypes.ELASTICSEARCH]: "ElasticSearch",
|
|
|
|
[IntegrationTypes.SQL_SERVER]: "SQL Server",
|
|
|
|
[IntegrationTypes.AIRTABLE]: "Airtable",
|
|
|
|
[IntegrationTypes.ARANGODB]: "ArangoDB",
|
|
|
|
[IntegrationTypes.ORACLE]: "Oracle",
|
|
|
|
[IntegrationTypes.INTERNAL]: "Internal",
|
2022-01-15 19:28:04 +01:00
|
|
|
[IntegrationTypes.GOOGLE_SHEETS]: "Google Sheets",
|
2022-06-08 13:05:29 +02:00
|
|
|
[IntegrationTypes.FIRESTORE]: "Firestore",
|
2022-03-31 11:56:16 +02:00
|
|
|
[IntegrationTypes.REDIS]: "Redis",
|
2022-05-30 22:13:45 +02:00
|
|
|
[IntegrationTypes.SNOWFLAKE]: "Snowflake",
|
2021-12-06 18:39:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export const SchemaTypeOptions = [
|
|
|
|
{ label: "Text", value: "string" },
|
|
|
|
{ label: "Number", value: "number" },
|
|
|
|
{ label: "Boolean", value: "boolean" },
|
|
|
|
{ label: "Datetime", value: "datetime" },
|
|
|
|
]
|
|
|
|
|
|
|
|
export const RawRestBodyTypes = {
|
|
|
|
NONE: "none",
|
|
|
|
FORM: "form",
|
|
|
|
ENCODED: "encoded",
|
|
|
|
JSON: "json",
|
|
|
|
TEXT: "text",
|
2021-12-14 18:59:02 +01:00
|
|
|
XML: "xml",
|
2021-12-06 18:39:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export const RestBodyTypes = [
|
|
|
|
{ name: "none", value: "none" },
|
|
|
|
{ name: "form-data", value: "form" },
|
|
|
|
{ name: "x-www-form-encoded", value: "encoded" },
|
|
|
|
{ name: "raw (JSON)", value: "json" },
|
2021-12-14 18:59:02 +01:00
|
|
|
{ name: "raw (XML)", value: "xml" },
|
2021-12-06 18:39:51 +01:00
|
|
|
{ name: "raw (Text)", value: "text" },
|
|
|
|
]
|
2021-12-17 12:37:50 +01:00
|
|
|
|
|
|
|
export const PaginationTypes = [
|
|
|
|
{ label: "Page number based", value: "page" },
|
|
|
|
{ label: "Cursor based", value: "cursor" },
|
|
|
|
]
|
|
|
|
|
|
|
|
export const PaginationLocations = [
|
|
|
|
{ label: "Query parameters", value: "query" },
|
|
|
|
{ label: "Request body", value: "body" },
|
|
|
|
]
|
2022-01-14 18:42:14 +01:00
|
|
|
|
|
|
|
export const BannedSearchTypes = [
|
|
|
|
"link",
|
|
|
|
"attachment",
|
|
|
|
"formula",
|
|
|
|
"json",
|
|
|
|
"jsonarray",
|
|
|
|
]
|
2022-12-19 09:23:24 +01:00
|
|
|
|
|
|
|
export const DatasourceTypes = {
|
|
|
|
RELATIONAL: "Relational",
|
|
|
|
NON_RELATIONAL: "Non-relational",
|
|
|
|
SPREADSHEET: "Spreadsheet",
|
|
|
|
OBJECT_STORE: "Object store",
|
|
|
|
GRAPH: "Graph",
|
|
|
|
API: "API",
|
|
|
|
}
|
2023-08-31 09:42:31 +02:00
|
|
|
|
|
|
|
export const ROW_EXPORT_FORMATS = {
|
|
|
|
CSV: "csv",
|
|
|
|
JSON: "json",
|
|
|
|
JSON_WITH_SCHEMA: "jsonWithSchema",
|
|
|
|
}
|