2021-05-14 16:43:41 +02:00
|
|
|
const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles")
|
2021-04-21 17:42:44 +02:00
|
|
|
const { UserStatus } = require("@budibase/auth").constants
|
2021-05-06 20:27:24 +02:00
|
|
|
const { ObjectStoreBuckets } = require("@budibase/auth").objectStore
|
2020-11-25 16:03:19 +01:00
|
|
|
|
2021-05-18 17:37:54 +02:00
|
|
|
exports.JobQueues = {
|
2021-05-18 22:03:26 +02:00
|
|
|
AUTOMATIONS: "automationQueue",
|
2021-05-18 17:37:54 +02:00
|
|
|
}
|
|
|
|
|
2021-02-22 12:39:58 +01:00
|
|
|
exports.FieldTypes = {
|
|
|
|
STRING: "string",
|
|
|
|
LONGFORM: "longform",
|
|
|
|
OPTIONS: "options",
|
|
|
|
NUMBER: "number",
|
|
|
|
BOOLEAN: "boolean",
|
2021-08-19 17:54:44 +02:00
|
|
|
ARRAY: "array",
|
2021-02-22 12:39:58 +01:00
|
|
|
DATETIME: "datetime",
|
|
|
|
ATTACHMENT: "attachment",
|
|
|
|
LINK: "link",
|
2021-04-29 20:06:58 +02:00
|
|
|
FORMULA: "formula",
|
2021-02-22 12:39:58 +01:00
|
|
|
AUTO: "auto",
|
2021-06-24 19:16:48 +02:00
|
|
|
JSON: "json",
|
2021-02-22 12:39:58 +01:00
|
|
|
}
|
|
|
|
|
2021-02-25 13:21:24 +01:00
|
|
|
exports.RelationshipTypes = {
|
|
|
|
ONE_TO_MANY: "one-to-many",
|
2021-03-01 18:06:08 +01:00
|
|
|
MANY_TO_ONE: "many-to-one",
|
2021-02-25 13:23:47 +01:00
|
|
|
MANY_TO_MANY: "many-to-many",
|
2021-02-25 13:21:24 +01:00
|
|
|
}
|
|
|
|
|
2021-02-22 12:39:58 +01:00
|
|
|
exports.AuthTypes = {
|
2020-10-13 22:33:56 +02:00
|
|
|
APP: "app",
|
|
|
|
BUILDER: "builder",
|
|
|
|
EXTERNAL: "external",
|
|
|
|
}
|
|
|
|
|
2021-06-04 15:53:49 +02:00
|
|
|
exports.DataSourceOperation = {
|
|
|
|
CREATE: "CREATE",
|
|
|
|
READ: "READ",
|
|
|
|
UPDATE: "UPDATE",
|
|
|
|
DELETE: "DELETE",
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.SortDirection = {
|
|
|
|
ASCENDING: "ASCENDING",
|
|
|
|
DESCENDING: "DESCENDING",
|
|
|
|
}
|
|
|
|
|
2021-02-22 12:39:58 +01:00
|
|
|
exports.USERS_TABLE_SCHEMA = {
|
2020-11-25 16:03:19 +01:00
|
|
|
_id: "ta_users",
|
|
|
|
type: "table",
|
|
|
|
views: {},
|
|
|
|
name: "Users",
|
2021-04-19 17:26:33 +02:00
|
|
|
// TODO: ADMIN PANEL - when implemented this doesn't need to be carried out
|
2020-11-25 16:03:19 +01:00
|
|
|
schema: {
|
2020-12-04 13:22:45 +01:00
|
|
|
email: {
|
2021-02-22 12:39:58 +01:00
|
|
|
type: exports.FieldTypes.STRING,
|
2020-11-25 16:03:19 +01:00
|
|
|
constraints: {
|
2021-02-22 12:39:58 +01:00
|
|
|
type: exports.FieldTypes.STRING,
|
2020-12-04 13:22:45 +01:00
|
|
|
email: true,
|
2020-11-25 16:03:19 +01:00
|
|
|
length: {
|
|
|
|
maximum: "",
|
|
|
|
},
|
|
|
|
presence: true,
|
|
|
|
},
|
2020-12-04 13:22:45 +01:00
|
|
|
fieldName: "email",
|
|
|
|
name: "email",
|
2020-11-25 16:03:19 +01:00
|
|
|
},
|
2021-05-19 12:06:57 +02:00
|
|
|
firstName: {
|
|
|
|
name: "firstName",
|
|
|
|
fieldName: "firstName",
|
|
|
|
type: exports.FieldTypes.STRING,
|
|
|
|
constraints: {
|
|
|
|
type: exports.FieldTypes.STRING,
|
|
|
|
presence: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
lastName: {
|
|
|
|
name: "lastName",
|
|
|
|
fieldName: "lastName",
|
|
|
|
type: exports.FieldTypes.STRING,
|
|
|
|
constraints: {
|
|
|
|
type: exports.FieldTypes.STRING,
|
|
|
|
presence: false,
|
|
|
|
},
|
|
|
|
},
|
2020-12-02 14:20:56 +01:00
|
|
|
roleId: {
|
|
|
|
fieldName: "roleId",
|
|
|
|
name: "roleId",
|
2021-02-22 12:39:58 +01:00
|
|
|
type: exports.FieldTypes.OPTIONS,
|
2020-11-25 16:03:19 +01:00
|
|
|
constraints: {
|
2021-02-22 12:39:58 +01:00
|
|
|
type: exports.FieldTypes.STRING,
|
2020-11-25 16:03:19 +01:00
|
|
|
presence: false,
|
2020-12-08 13:20:37 +01:00
|
|
|
inclusion: Object.values(BUILTIN_ROLE_IDS),
|
2020-11-25 16:03:19 +01:00
|
|
|
},
|
|
|
|
},
|
2021-02-22 13:29:49 +01:00
|
|
|
status: {
|
|
|
|
fieldName: "status",
|
|
|
|
name: "status",
|
|
|
|
type: exports.FieldTypes.OPTIONS,
|
2021-02-22 12:39:58 +01:00
|
|
|
constraints: {
|
2021-02-22 13:29:49 +01:00
|
|
|
type: exports.FieldTypes.STRING,
|
2021-02-22 12:39:58 +01:00
|
|
|
presence: false,
|
2021-04-08 17:58:33 +02:00
|
|
|
inclusion: Object.values(UserStatus),
|
2021-02-22 12:39:58 +01:00
|
|
|
},
|
|
|
|
},
|
2020-11-25 16:03:19 +01:00
|
|
|
},
|
2020-12-04 13:22:45 +01:00
|
|
|
primaryDisplay: "email",
|
2020-11-25 16:03:19 +01:00
|
|
|
}
|
|
|
|
|
2021-02-15 18:47:14 +01:00
|
|
|
exports.AutoFieldSubTypes = {
|
|
|
|
CREATED_BY: "createdBy",
|
|
|
|
CREATED_AT: "createdAt",
|
|
|
|
UPDATED_BY: "updatedBy",
|
|
|
|
UPDATED_AT: "updatedAt",
|
|
|
|
AUTO_ID: "autoID",
|
|
|
|
}
|
|
|
|
|
2021-05-24 23:39:13 +02:00
|
|
|
exports.OBJ_STORE_DIRECTORY = "/prod-budi-app-assets"
|
2021-02-05 17:45:23 +01:00
|
|
|
exports.BaseQueryVerbs = {
|
|
|
|
CREATE: "create",
|
|
|
|
READ: "read",
|
|
|
|
UPDATE: "update",
|
|
|
|
DELETE: "delete",
|
|
|
|
}
|
2021-03-19 20:07:47 +01:00
|
|
|
|
2021-05-06 20:27:24 +02:00
|
|
|
// pass through the list from the auth/core lib
|
|
|
|
exports.ObjectStoreBuckets = ObjectStoreBuckets
|