2020-12-02 14:20:56 +01:00
|
|
|
const { BUILTIN_ROLE_IDS } = require("../utilities/security/roles")
|
2020-11-25 16:03:19 +01:00
|
|
|
|
2020-10-13 22:33:56 +02:00
|
|
|
const AuthTypes = {
|
|
|
|
APP: "app",
|
|
|
|
BUILDER: "builder",
|
|
|
|
EXTERNAL: "external",
|
|
|
|
}
|
|
|
|
|
2020-11-25 16:03:19 +01:00
|
|
|
const USERS_TABLE_SCHEMA = {
|
|
|
|
_id: "ta_users",
|
|
|
|
type: "table",
|
|
|
|
views: {},
|
|
|
|
name: "Users",
|
|
|
|
schema: {
|
2020-12-04 13:22:45 +01:00
|
|
|
email: {
|
2020-11-25 16:03:19 +01:00
|
|
|
type: "string",
|
|
|
|
constraints: {
|
|
|
|
type: "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
|
|
|
},
|
2020-12-02 14:20:56 +01:00
|
|
|
roleId: {
|
|
|
|
fieldName: "roleId",
|
|
|
|
name: "roleId",
|
2020-11-25 16:03:19 +01:00
|
|
|
type: "options",
|
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
presence: false,
|
2020-12-08 13:20:37 +01:00
|
|
|
inclusion: Object.values(BUILTIN_ROLE_IDS),
|
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
|
|
|
}
|
|
|
|
|
2020-10-13 22:33:56 +02:00
|
|
|
exports.AuthTypes = AuthTypes
|
2020-11-25 16:03:19 +01:00
|
|
|
exports.USERS_TABLE_SCHEMA = USERS_TABLE_SCHEMA
|