1
0
Fork 0
mirror of synced 2024-07-03 13:30:46 +12:00
budibase/packages/server/src/constants/index.js

97 lines
2.1 KiB
JavaScript
Raw Normal View History

const { BUILTIN_ROLE_IDS } = require("../utilities/security/roles")
const { UserStatus } = require("@budibase/auth").constants
2020-11-26 04:03:19 +13:00
exports.LOGO_URL =
"https://d33wubrfki0l68.cloudfront.net/aac32159d7207b5085e74a7ef67afbb7027786c5/2b1fd/img/logo/bb-emblem.svg"
exports.FieldTypes = {
STRING: "string",
LONGFORM: "longform",
OPTIONS: "options",
NUMBER: "number",
BOOLEAN: "boolean",
DATETIME: "datetime",
ATTACHMENT: "attachment",
LINK: "link",
FORMULA: "formula",
AUTO: "auto",
}
2021-02-26 01:21:24 +13:00
exports.RelationshipTypes = {
ONE_TO_MANY: "one-to-many",
MANY_TO_ONE: "many-to-one",
2021-02-26 01:23:47 +13:00
MANY_TO_MANY: "many-to-many",
2021-02-26 01:21:24 +13:00
}
exports.AuthTypes = {
APP: "app",
BUILDER: "builder",
EXTERNAL: "external",
}
exports.USERS_TABLE_SCHEMA = {
2020-11-26 04:03:19 +13:00
_id: "ta_users",
type: "table",
views: {},
name: "Users",
// TODO: ADMIN PANEL - when implemented this doesn't need to be carried out
2020-11-26 04:03:19 +13:00
schema: {
2020-12-05 01:22:45 +13:00
email: {
type: exports.FieldTypes.STRING,
2020-11-26 04:03:19 +13:00
constraints: {
type: exports.FieldTypes.STRING,
2020-12-05 01:22:45 +13:00
email: true,
2020-11-26 04:03:19 +13:00
length: {
maximum: "",
},
presence: true,
},
2020-12-05 01:22:45 +13:00
fieldName: "email",
name: "email",
2020-11-26 04:03:19 +13:00
},
roleId: {
fieldName: "roleId",
name: "roleId",
type: exports.FieldTypes.OPTIONS,
2020-11-26 04:03:19 +13:00
constraints: {
type: exports.FieldTypes.STRING,
2020-11-26 04:03:19 +13:00
presence: false,
inclusion: Object.values(BUILTIN_ROLE_IDS),
2020-11-26 04:03:19 +13:00
},
},
status: {
fieldName: "status",
name: "status",
type: exports.FieldTypes.OPTIONS,
constraints: {
type: exports.FieldTypes.STRING,
presence: false,
inclusion: Object.values(UserStatus),
},
},
2020-11-26 04:03:19 +13:00
},
2020-12-05 01:22:45 +13:00
primaryDisplay: "email",
2020-11-26 04:03:19 +13:00
}
exports.AutoFieldSubTypes = {
CREATED_BY: "createdBy",
CREATED_AT: "createdAt",
UPDATED_BY: "updatedBy",
UPDATED_AT: "updatedAt",
AUTO_ID: "autoID",
}
exports.OBJ_STORE_DIRECTORY = "/app-assets/assets"
exports.BaseQueryVerbs = {
CREATE: "create",
READ: "read",
UPDATE: "update",
DELETE: "delete",
}
exports.ObjectStoreBuckets = {
BACKUPS: "backups",
2021-03-25 07:31:13 +13:00
APPS: "prod-budi-app-assets",
TEMPLATES: "templates",
}