Merge branch 'develop' of github.com:Budibase/budibase into feature/replace-pouch
This commit is contained in:
commit
a5624142a8
|
@ -66,6 +66,15 @@ http {
|
||||||
proxy_set_header Connection "";
|
proxy_set_header Connection "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /api/backups/ {
|
||||||
|
proxy_read_timeout 1800s;
|
||||||
|
proxy_connect_timeout 1800s;
|
||||||
|
proxy_send_timeout 1800s;
|
||||||
|
proxy_pass http://app-service;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
}
|
||||||
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_read_timeout 120s;
|
proxy_read_timeout 120s;
|
||||||
proxy_connect_timeout 120s;
|
proxy_connect_timeout 120s;
|
||||||
|
|
|
@ -116,6 +116,15 @@ http {
|
||||||
rewrite ^/worker/(.*)$ /$1 break;
|
rewrite ^/worker/(.*)$ /$1 break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /api/backups/ {
|
||||||
|
proxy_read_timeout 1800s;
|
||||||
|
proxy_connect_timeout 1800s;
|
||||||
|
proxy_send_timeout 1800s;
|
||||||
|
proxy_pass http://app-service;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
}
|
||||||
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
# calls to the API are rate limited with bursting
|
# calls to the API are rate limited with bursting
|
||||||
limit_req zone=ratelimit burst=20 nodelay;
|
limit_req zone=ratelimit burst=20 nodelay;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/backend-core",
|
"name": "@budibase/backend-core",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"description": "Budibase backend core libraries used in server and worker",
|
"description": "Budibase backend core libraries used in server and worker",
|
||||||
"main": "dist/src/index.js",
|
"main": "dist/src/index.js",
|
||||||
"types": "dist/src/index.d.ts",
|
"types": "dist/src/index.d.ts",
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
"test:watch": "jest --watchAll"
|
"test:watch": "jest --watchAll"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/types": "2.1.19-alpha.0",
|
"@budibase/types": "2.1.22-alpha.0",
|
||||||
"@shopify/jest-koa-mocks": "5.0.1",
|
"@shopify/jest-koa-mocks": "5.0.1",
|
||||||
"@techpass/passport-openidconnect": "0.3.2",
|
"@techpass/passport-openidconnect": "0.3.2",
|
||||||
"aws-sdk": "2.1030.0",
|
"aws-sdk": "2.1030.0",
|
||||||
|
|
|
@ -22,7 +22,19 @@ type ListParams = {
|
||||||
ContinuationToken?: string
|
ContinuationToken?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UploadParams = {
|
||||||
|
bucket: string
|
||||||
|
filename: string
|
||||||
|
path: string
|
||||||
|
type?: string
|
||||||
|
// can be undefined, we will remove it
|
||||||
|
metadata?: {
|
||||||
|
[key: string]: string | undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const CONTENT_TYPE_MAP: any = {
|
const CONTENT_TYPE_MAP: any = {
|
||||||
|
txt: "text/plain",
|
||||||
html: "text/html",
|
html: "text/html",
|
||||||
css: "text/css",
|
css: "text/css",
|
||||||
js: "application/javascript",
|
js: "application/javascript",
|
||||||
|
@ -149,20 +161,32 @@ export const upload = async ({
|
||||||
path,
|
path,
|
||||||
type,
|
type,
|
||||||
metadata,
|
metadata,
|
||||||
}: any) => {
|
}: UploadParams) => {
|
||||||
const extension = filename.split(".").pop()
|
const extension = filename.split(".").pop()
|
||||||
const fileBytes = fs.readFileSync(path)
|
const fileBytes = fs.readFileSync(path)
|
||||||
|
|
||||||
const objectStore = ObjectStore(bucketName)
|
const objectStore = ObjectStore(bucketName)
|
||||||
await makeSureBucketExists(objectStore, bucketName)
|
await makeSureBucketExists(objectStore, bucketName)
|
||||||
|
|
||||||
|
let contentType = type
|
||||||
|
if (!contentType) {
|
||||||
|
contentType = extension
|
||||||
|
? CONTENT_TYPE_MAP[extension.toLowerCase()]
|
||||||
|
: CONTENT_TYPE_MAP.txt
|
||||||
|
}
|
||||||
const config: any = {
|
const config: any = {
|
||||||
// windows file paths need to be converted to forward slashes for s3
|
// windows file paths need to be converted to forward slashes for s3
|
||||||
Key: sanitizeKey(filename),
|
Key: sanitizeKey(filename),
|
||||||
Body: fileBytes,
|
Body: fileBytes,
|
||||||
ContentType: type || CONTENT_TYPE_MAP[extension.toLowerCase()],
|
ContentType: contentType,
|
||||||
|
}
|
||||||
|
if (metadata && typeof metadata === "object") {
|
||||||
|
// remove any nullish keys from the metadata object, as these may be considered invalid
|
||||||
|
for (let key of Object.keys(metadata)) {
|
||||||
|
if (!metadata[key] || typeof metadata[key] !== "string") {
|
||||||
|
delete metadata[key]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (metadata) {
|
|
||||||
config.Metadata = metadata
|
config.Metadata = metadata
|
||||||
}
|
}
|
||||||
return objectStore.upload(config).promise()
|
return objectStore.upload(config).promise()
|
||||||
|
|
|
@ -1,21 +1,27 @@
|
||||||
const { cloneDeep } = require("lodash/fp")
|
import { BUILTIN_PERMISSION_IDS, PermissionLevels } from "./permissions"
|
||||||
const { BUILTIN_PERMISSION_IDS, PermissionLevels } = require("./permissions")
|
import {
|
||||||
const {
|
|
||||||
generateRoleID,
|
generateRoleID,
|
||||||
getRoleParams,
|
getRoleParams,
|
||||||
DocumentType,
|
DocumentType,
|
||||||
SEPARATOR,
|
SEPARATOR,
|
||||||
} = require("../db/utils")
|
} from "../db/utils"
|
||||||
const { getAppDB } = require("../context")
|
import { getAppDB } from "../context"
|
||||||
const { doWithDB } = require("../db")
|
import { doWithDB } from "../db"
|
||||||
|
import { Screen, Role as RoleDoc } from "@budibase/types"
|
||||||
|
const { cloneDeep } = require("lodash/fp")
|
||||||
|
|
||||||
const BUILTIN_IDS = {
|
export const BUILTIN_ROLE_IDS = {
|
||||||
ADMIN: "ADMIN",
|
ADMIN: "ADMIN",
|
||||||
POWER: "POWER",
|
POWER: "POWER",
|
||||||
BASIC: "BASIC",
|
BASIC: "BASIC",
|
||||||
PUBLIC: "PUBLIC",
|
PUBLIC: "PUBLIC",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const BUILTIN_IDS = {
|
||||||
|
...BUILTIN_ROLE_IDS,
|
||||||
|
BUILDER: "BUILDER",
|
||||||
|
}
|
||||||
|
|
||||||
// exclude internal roles like builder
|
// exclude internal roles like builder
|
||||||
const EXTERNAL_BUILTIN_ROLE_IDS = [
|
const EXTERNAL_BUILTIN_ROLE_IDS = [
|
||||||
BUILTIN_IDS.ADMIN,
|
BUILTIN_IDS.ADMIN,
|
||||||
|
@ -24,19 +30,26 @@ const EXTERNAL_BUILTIN_ROLE_IDS = [
|
||||||
BUILTIN_IDS.PUBLIC,
|
BUILTIN_IDS.PUBLIC,
|
||||||
]
|
]
|
||||||
|
|
||||||
function Role(id, name) {
|
export class Role {
|
||||||
|
_id: string
|
||||||
|
name: string
|
||||||
|
permissionId?: string
|
||||||
|
inherits?: string
|
||||||
|
|
||||||
|
constructor(id: string, name: string) {
|
||||||
this._id = id
|
this._id = id
|
||||||
this.name = name
|
this.name = name
|
||||||
}
|
}
|
||||||
|
|
||||||
Role.prototype.addPermission = function (permissionId) {
|
addPermission(permissionId: string) {
|
||||||
this.permissionId = permissionId
|
this.permissionId = permissionId
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
Role.prototype.addInheritance = function (inherits) {
|
addInheritance(inherits: string) {
|
||||||
this.inherits = inherits
|
this.inherits = inherits
|
||||||
return this
|
return this
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const BUILTIN_ROLES = {
|
const BUILTIN_ROLES = {
|
||||||
|
@ -57,27 +70,30 @@ const BUILTIN_ROLES = {
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.getBuiltinRoles = () => {
|
export function getBuiltinRoles() {
|
||||||
return cloneDeep(BUILTIN_ROLES)
|
return cloneDeep(BUILTIN_ROLES)
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.BUILTIN_ROLE_ID_ARRAY = Object.values(BUILTIN_ROLES).map(
|
export const BUILTIN_ROLE_ID_ARRAY = Object.values(BUILTIN_ROLES).map(
|
||||||
role => role._id
|
role => role._id
|
||||||
)
|
)
|
||||||
|
|
||||||
exports.BUILTIN_ROLE_NAME_ARRAY = Object.values(BUILTIN_ROLES).map(
|
export const BUILTIN_ROLE_NAME_ARRAY = Object.values(BUILTIN_ROLES).map(
|
||||||
role => role.name
|
role => role.name
|
||||||
)
|
)
|
||||||
|
|
||||||
function isBuiltin(role) {
|
export function isBuiltin(role?: string) {
|
||||||
return exports.BUILTIN_ROLE_ID_ARRAY.some(builtin => role.includes(builtin))
|
return BUILTIN_ROLE_ID_ARRAY.some(builtin => role?.includes(builtin))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Works through the inheritance ranks to see how far up the builtin stack this ID is.
|
* Works through the inheritance ranks to see how far up the builtin stack this ID is.
|
||||||
*/
|
*/
|
||||||
exports.builtinRoleToNumber = id => {
|
export function builtinRoleToNumber(id?: string) {
|
||||||
const builtins = exports.getBuiltinRoles()
|
if (!id) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
const builtins = getBuiltinRoles()
|
||||||
const MAX = Object.values(builtins).length + 1
|
const MAX = Object.values(builtins).length + 1
|
||||||
if (id === BUILTIN_IDS.ADMIN || id === BUILTIN_IDS.BUILDER) {
|
if (id === BUILTIN_IDS.ADMIN || id === BUILTIN_IDS.BUILDER) {
|
||||||
return MAX
|
return MAX
|
||||||
|
@ -97,14 +113,14 @@ exports.builtinRoleToNumber = id => {
|
||||||
/**
|
/**
|
||||||
* Converts any role to a number, but has to be async to get the roles from db.
|
* Converts any role to a number, but has to be async to get the roles from db.
|
||||||
*/
|
*/
|
||||||
exports.roleToNumber = async id => {
|
export async function roleToNumber(id?: string) {
|
||||||
if (exports.isBuiltin(id)) {
|
if (isBuiltin(id)) {
|
||||||
return exports.builtinRoleToNumber(id)
|
return builtinRoleToNumber(id)
|
||||||
}
|
}
|
||||||
const hierarchy = await exports.getUserRoleHierarchy(id)
|
const hierarchy = (await getUserRoleHierarchy(id)) as RoleDoc[]
|
||||||
for (let role of hierarchy) {
|
for (let role of hierarchy) {
|
||||||
if (isBuiltin(role.inherits)) {
|
if (isBuiltin(role?.inherits)) {
|
||||||
return exports.builtinRoleToNumber(role.inherits) + 1
|
return builtinRoleToNumber(role.inherits) + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
|
@ -113,15 +129,14 @@ exports.roleToNumber = async id => {
|
||||||
/**
|
/**
|
||||||
* Returns whichever builtin roleID is lower.
|
* Returns whichever builtin roleID is lower.
|
||||||
*/
|
*/
|
||||||
exports.lowerBuiltinRoleID = (roleId1, roleId2) => {
|
export function lowerBuiltinRoleID(roleId1?: string, roleId2?: string) {
|
||||||
if (!roleId1) {
|
if (!roleId1) {
|
||||||
return roleId2
|
return roleId2
|
||||||
}
|
}
|
||||||
if (!roleId2) {
|
if (!roleId2) {
|
||||||
return roleId1
|
return roleId1
|
||||||
}
|
}
|
||||||
return exports.builtinRoleToNumber(roleId1) >
|
return builtinRoleToNumber(roleId1) > builtinRoleToNumber(roleId2)
|
||||||
exports.builtinRoleToNumber(roleId2)
|
|
||||||
? roleId2
|
? roleId2
|
||||||
: roleId1
|
: roleId1
|
||||||
}
|
}
|
||||||
|
@ -132,11 +147,11 @@ exports.lowerBuiltinRoleID = (roleId1, roleId2) => {
|
||||||
* @param {string|null} roleId The level ID to lookup.
|
* @param {string|null} roleId The level ID to lookup.
|
||||||
* @returns {Promise<Role|object|null>} The role object, which may contain an "inherits" property.
|
* @returns {Promise<Role|object|null>} The role object, which may contain an "inherits" property.
|
||||||
*/
|
*/
|
||||||
exports.getRole = async roleId => {
|
export async function getRole(roleId?: string) {
|
||||||
if (!roleId) {
|
if (!roleId) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
let role = {}
|
let role: any = {}
|
||||||
// built in roles mostly come from the in-code implementation,
|
// built in roles mostly come from the in-code implementation,
|
||||||
// but can be extended by a doc stored about them (e.g. permissions)
|
// but can be extended by a doc stored about them (e.g. permissions)
|
||||||
if (isBuiltin(roleId)) {
|
if (isBuiltin(roleId)) {
|
||||||
|
@ -146,10 +161,10 @@ exports.getRole = async roleId => {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const db = getAppDB()
|
const db = getAppDB()
|
||||||
const dbRole = await db.get(exports.getDBRoleID(roleId))
|
const dbRole = await db.get(getDBRoleID(roleId))
|
||||||
role = Object.assign(role, dbRole)
|
role = Object.assign(role, dbRole)
|
||||||
// finalise the ID
|
// finalise the ID
|
||||||
role._id = exports.getExternalRoleID(role._id)
|
role._id = getExternalRoleID(role._id)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// only throw an error if there is no role at all
|
// only throw an error if there is no role at all
|
||||||
if (Object.keys(role).length === 0) {
|
if (Object.keys(role).length === 0) {
|
||||||
|
@ -162,12 +177,12 @@ exports.getRole = async roleId => {
|
||||||
/**
|
/**
|
||||||
* Simple function to get all the roles based on the top level user role ID.
|
* Simple function to get all the roles based on the top level user role ID.
|
||||||
*/
|
*/
|
||||||
async function getAllUserRoles(userRoleId) {
|
async function getAllUserRoles(userRoleId?: string): Promise<RoleDoc[]> {
|
||||||
// admins have access to all roles
|
// admins have access to all roles
|
||||||
if (userRoleId === BUILTIN_IDS.ADMIN) {
|
if (userRoleId === BUILTIN_IDS.ADMIN) {
|
||||||
return exports.getAllRoles()
|
return getAllRoles()
|
||||||
}
|
}
|
||||||
let currentRole = await exports.getRole(userRoleId)
|
let currentRole = await getRole(userRoleId)
|
||||||
let roles = currentRole ? [currentRole] : []
|
let roles = currentRole ? [currentRole] : []
|
||||||
let roleIds = [userRoleId]
|
let roleIds = [userRoleId]
|
||||||
// get all the inherited roles
|
// get all the inherited roles
|
||||||
|
@ -177,7 +192,7 @@ async function getAllUserRoles(userRoleId) {
|
||||||
roleIds.indexOf(currentRole.inherits) === -1
|
roleIds.indexOf(currentRole.inherits) === -1
|
||||||
) {
|
) {
|
||||||
roleIds.push(currentRole.inherits)
|
roleIds.push(currentRole.inherits)
|
||||||
currentRole = await exports.getRole(currentRole.inherits)
|
currentRole = await getRole(currentRole.inherits)
|
||||||
roles.push(currentRole)
|
roles.push(currentRole)
|
||||||
}
|
}
|
||||||
return roles
|
return roles
|
||||||
|
@ -191,7 +206,10 @@ async function getAllUserRoles(userRoleId) {
|
||||||
* @returns {Promise<string[]|object[]>} returns an ordered array of the roles, with the first being their
|
* @returns {Promise<string[]|object[]>} returns an ordered array of the roles, with the first being their
|
||||||
* highest level of access and the last being the lowest level.
|
* highest level of access and the last being the lowest level.
|
||||||
*/
|
*/
|
||||||
exports.getUserRoleHierarchy = async (userRoleId, opts = { idOnly: true }) => {
|
export async function getUserRoleHierarchy(
|
||||||
|
userRoleId?: string,
|
||||||
|
opts = { idOnly: true }
|
||||||
|
) {
|
||||||
// special case, if they don't have a role then they are a public user
|
// special case, if they don't have a role then they are a public user
|
||||||
const roles = await getAllUserRoles(userRoleId)
|
const roles = await getAllUserRoles(userRoleId)
|
||||||
return opts.idOnly ? roles.map(role => role._id) : roles
|
return opts.idOnly ? roles.map(role => role._id) : roles
|
||||||
|
@ -200,9 +218,12 @@ exports.getUserRoleHierarchy = async (userRoleId, opts = { idOnly: true }) => {
|
||||||
// this function checks that the provided permissions are in an array format
|
// this function checks that the provided permissions are in an array format
|
||||||
// some templates/older apps will use a simple string instead of array for roles
|
// some templates/older apps will use a simple string instead of array for roles
|
||||||
// convert the string to an array using the theory that write is higher than read
|
// convert the string to an array using the theory that write is higher than read
|
||||||
exports.checkForRoleResourceArray = (rolePerms, resourceId) => {
|
export function checkForRoleResourceArray(
|
||||||
|
rolePerms: { [key: string]: string[] },
|
||||||
|
resourceId: string
|
||||||
|
) {
|
||||||
if (rolePerms && !Array.isArray(rolePerms[resourceId])) {
|
if (rolePerms && !Array.isArray(rolePerms[resourceId])) {
|
||||||
const permLevel = rolePerms[resourceId]
|
const permLevel = rolePerms[resourceId] as any
|
||||||
rolePerms[resourceId] = [permLevel]
|
rolePerms[resourceId] = [permLevel]
|
||||||
if (permLevel === PermissionLevels.WRITE) {
|
if (permLevel === PermissionLevels.WRITE) {
|
||||||
rolePerms[resourceId].push(PermissionLevels.READ)
|
rolePerms[resourceId].push(PermissionLevels.READ)
|
||||||
|
@ -215,7 +236,7 @@ exports.checkForRoleResourceArray = (rolePerms, resourceId) => {
|
||||||
* Given an app ID this will retrieve all of the roles that are currently within that app.
|
* Given an app ID this will retrieve all of the roles that are currently within that app.
|
||||||
* @return {Promise<object[]>} An array of the role objects that were found.
|
* @return {Promise<object[]>} An array of the role objects that were found.
|
||||||
*/
|
*/
|
||||||
exports.getAllRoles = async appId => {
|
export async function getAllRoles(appId?: string) {
|
||||||
if (appId) {
|
if (appId) {
|
||||||
return doWithDB(appId, internal)
|
return doWithDB(appId, internal)
|
||||||
} else {
|
} else {
|
||||||
|
@ -227,30 +248,30 @@ exports.getAllRoles = async appId => {
|
||||||
}
|
}
|
||||||
return internal(appDB)
|
return internal(appDB)
|
||||||
}
|
}
|
||||||
async function internal(db) {
|
async function internal(db: any) {
|
||||||
let roles = []
|
let roles: RoleDoc[] = []
|
||||||
if (db) {
|
if (db) {
|
||||||
const body = await db.allDocs(
|
const body = await db.allDocs(
|
||||||
getRoleParams(null, {
|
getRoleParams(null, {
|
||||||
include_docs: true,
|
include_docs: true,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
roles = body.rows.map(row => row.doc)
|
roles = body.rows.map((row: any) => row.doc)
|
||||||
}
|
}
|
||||||
const builtinRoles = exports.getBuiltinRoles()
|
const builtinRoles = getBuiltinRoles()
|
||||||
|
|
||||||
// need to combine builtin with any DB record of them (for sake of permissions)
|
// need to combine builtin with any DB record of them (for sake of permissions)
|
||||||
for (let builtinRoleId of EXTERNAL_BUILTIN_ROLE_IDS) {
|
for (let builtinRoleId of EXTERNAL_BUILTIN_ROLE_IDS) {
|
||||||
const builtinRole = builtinRoles[builtinRoleId]
|
const builtinRole = builtinRoles[builtinRoleId]
|
||||||
const dbBuiltin = roles.filter(
|
const dbBuiltin = roles.filter(
|
||||||
dbRole => exports.getExternalRoleID(dbRole._id) === builtinRoleId
|
dbRole => getExternalRoleID(dbRole._id) === builtinRoleId
|
||||||
)[0]
|
)[0]
|
||||||
if (dbBuiltin == null) {
|
if (dbBuiltin == null) {
|
||||||
roles.push(builtinRole || builtinRoles.BASIC)
|
roles.push(builtinRole || builtinRoles.BASIC)
|
||||||
} else {
|
} else {
|
||||||
// remove role and all back after combining with the builtin
|
// remove role and all back after combining with the builtin
|
||||||
roles = roles.filter(role => role._id !== dbBuiltin._id)
|
roles = roles.filter(role => role._id !== dbBuiltin._id)
|
||||||
dbBuiltin._id = exports.getExternalRoleID(dbBuiltin._id)
|
dbBuiltin._id = getExternalRoleID(dbBuiltin._id)
|
||||||
roles.push(Object.assign(builtinRole, dbBuiltin))
|
roles.push(Object.assign(builtinRole, dbBuiltin))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,7 +281,7 @@ exports.getAllRoles = async appId => {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for (let resourceId of Object.keys(role.permissions)) {
|
for (let resourceId of Object.keys(role.permissions)) {
|
||||||
role.permissions = exports.checkForRoleResourceArray(
|
role.permissions = checkForRoleResourceArray(
|
||||||
role.permissions,
|
role.permissions,
|
||||||
resourceId
|
resourceId
|
||||||
)
|
)
|
||||||
|
@ -277,11 +298,11 @@ exports.getAllRoles = async appId => {
|
||||||
* @param subResourceId The sub resource being requested
|
* @param subResourceId The sub resource being requested
|
||||||
* @return {Promise<{permissions}|Object>} returns the permissions required to access.
|
* @return {Promise<{permissions}|Object>} returns the permissions required to access.
|
||||||
*/
|
*/
|
||||||
exports.getRequiredResourceRole = async (
|
export async function getRequiredResourceRole(
|
||||||
permLevel,
|
permLevel: string,
|
||||||
{ resourceId, subResourceId }
|
{ resourceId, subResourceId }: { resourceId?: string; subResourceId?: string }
|
||||||
) => {
|
) {
|
||||||
const roles = await exports.getAllRoles()
|
const roles = await getAllRoles()
|
||||||
let main = [],
|
let main = [],
|
||||||
sub = []
|
sub = []
|
||||||
for (let role of roles) {
|
for (let role of roles) {
|
||||||
|
@ -289,8 +310,8 @@ exports.getRequiredResourceRole = async (
|
||||||
if (!role.permissions) {
|
if (!role.permissions) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const mainRes = role.permissions[resourceId]
|
const mainRes = resourceId ? role.permissions[resourceId] : undefined
|
||||||
const subRes = role.permissions[subResourceId]
|
const subRes = subResourceId ? role.permissions[subResourceId] : undefined
|
||||||
if (mainRes && mainRes.indexOf(permLevel) !== -1) {
|
if (mainRes && mainRes.indexOf(permLevel) !== -1) {
|
||||||
main.push(role._id)
|
main.push(role._id)
|
||||||
} else if (subRes && subRes.indexOf(permLevel) !== -1) {
|
} else if (subRes && subRes.indexOf(permLevel) !== -1) {
|
||||||
|
@ -301,12 +322,13 @@ exports.getRequiredResourceRole = async (
|
||||||
return main.concat(sub)
|
return main.concat(sub)
|
||||||
}
|
}
|
||||||
|
|
||||||
class AccessController {
|
export class AccessController {
|
||||||
|
userHierarchies: { [key: string]: string[] }
|
||||||
constructor() {
|
constructor() {
|
||||||
this.userHierarchies = {}
|
this.userHierarchies = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
async hasAccess(tryingRoleId, userRoleId) {
|
async hasAccess(tryingRoleId?: string, userRoleId?: string) {
|
||||||
// special cases, the screen has no role, the roles are the same or the user
|
// special cases, the screen has no role, the roles are the same or the user
|
||||||
// is currently in the builder
|
// is currently in the builder
|
||||||
if (
|
if (
|
||||||
|
@ -318,16 +340,18 @@ class AccessController {
|
||||||
) {
|
) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
let roleIds = this.userHierarchies[userRoleId]
|
let roleIds = userRoleId ? this.userHierarchies[userRoleId] : null
|
||||||
if (!roleIds) {
|
if (!roleIds && userRoleId) {
|
||||||
roleIds = await exports.getUserRoleHierarchy(userRoleId)
|
roleIds = (await getUserRoleHierarchy(userRoleId, {
|
||||||
|
idOnly: true,
|
||||||
|
})) as string[]
|
||||||
this.userHierarchies[userRoleId] = roleIds
|
this.userHierarchies[userRoleId] = roleIds
|
||||||
}
|
}
|
||||||
|
|
||||||
return roleIds.indexOf(tryingRoleId) !== -1
|
return roleIds?.indexOf(tryingRoleId) !== -1
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkScreensAccess(screens, userRoleId) {
|
async checkScreensAccess(screens: Screen[], userRoleId: string) {
|
||||||
let accessibleScreens = []
|
let accessibleScreens = []
|
||||||
// don't want to handle this with Promise.all as this would mean all custom roles would be
|
// don't want to handle this with Promise.all as this would mean all custom roles would be
|
||||||
// retrieved at same time, it is likely a custom role will be re-used and therefore want
|
// retrieved at same time, it is likely a custom role will be re-used and therefore want
|
||||||
|
@ -341,8 +365,8 @@ class AccessController {
|
||||||
return accessibleScreens
|
return accessibleScreens
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkScreenAccess(screen, userRoleId) {
|
async checkScreenAccess(screen: Screen, userRoleId: string) {
|
||||||
const roleId = screen && screen.routing ? screen.routing.roleId : null
|
const roleId = screen && screen.routing ? screen.routing.roleId : undefined
|
||||||
if (await this.hasAccess(roleId, userRoleId)) {
|
if (await this.hasAccess(roleId, userRoleId)) {
|
||||||
return screen
|
return screen
|
||||||
}
|
}
|
||||||
|
@ -353,8 +377,8 @@ class AccessController {
|
||||||
/**
|
/**
|
||||||
* Adds the "role_" for builtin role IDs which are to be written to the DB (for permissions).
|
* Adds the "role_" for builtin role IDs which are to be written to the DB (for permissions).
|
||||||
*/
|
*/
|
||||||
exports.getDBRoleID = roleId => {
|
export function getDBRoleID(roleId?: string) {
|
||||||
if (roleId.startsWith(DocumentType.ROLE)) {
|
if (roleId?.startsWith(DocumentType.ROLE)) {
|
||||||
return roleId
|
return roleId
|
||||||
}
|
}
|
||||||
return generateRoleID(roleId)
|
return generateRoleID(roleId)
|
||||||
|
@ -363,15 +387,10 @@ exports.getDBRoleID = roleId => {
|
||||||
/**
|
/**
|
||||||
* Remove the "role_" from builtin role IDs that have been written to the DB (for permissions).
|
* Remove the "role_" from builtin role IDs that have been written to the DB (for permissions).
|
||||||
*/
|
*/
|
||||||
exports.getExternalRoleID = roleId => {
|
export function getExternalRoleID(roleId?: string) {
|
||||||
// for built in roles we want to remove the DB role ID element (role_)
|
// for built-in roles we want to remove the DB role ID element (role_)
|
||||||
if (roleId.startsWith(DocumentType.ROLE) && isBuiltin(roleId)) {
|
if (roleId?.startsWith(DocumentType.ROLE) && isBuiltin(roleId)) {
|
||||||
return roleId.split(`${DocumentType.ROLE}${SEPARATOR}`)[1]
|
return roleId.split(`${DocumentType.ROLE}${SEPARATOR}`)[1]
|
||||||
}
|
}
|
||||||
return roleId
|
return roleId
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.AccessController = AccessController
|
|
||||||
exports.BUILTIN_ROLE_IDS = BUILTIN_IDS
|
|
||||||
exports.isBuiltin = isBuiltin
|
|
||||||
exports.Role = Role
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/bbui",
|
"name": "@budibase/bbui",
|
||||||
"description": "A UI solution used in the different Budibase projects.",
|
"description": "A UI solution used in the different Budibase projects.",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"svelte": "src/index.js",
|
"svelte": "src/index.js",
|
||||||
"module": "dist/bbui.es.js",
|
"module": "dist/bbui.es.js",
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
|
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
|
||||||
"@budibase/string-templates": "2.1.19-alpha.0",
|
"@budibase/string-templates": "2.1.22-alpha.0",
|
||||||
"@spectrum-css/actionbutton": "^1.0.1",
|
"@spectrum-css/actionbutton": "^1.0.1",
|
||||||
"@spectrum-css/actiongroup": "^1.0.1",
|
"@spectrum-css/actiongroup": "^1.0.1",
|
||||||
"@spectrum-css/avatar": "^3.0.2",
|
"@spectrum-css/avatar": "^3.0.2",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/builder",
|
"name": "@budibase/builder",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -71,10 +71,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "2.1.19-alpha.0",
|
"@budibase/bbui": "2.1.22-alpha.0",
|
||||||
"@budibase/client": "2.1.19-alpha.0",
|
"@budibase/client": "2.1.22-alpha.0",
|
||||||
"@budibase/frontend-core": "2.1.19-alpha.0",
|
"@budibase/frontend-core": "2.1.22-alpha.0",
|
||||||
"@budibase/string-templates": "2.1.19-alpha.0",
|
"@budibase/string-templates": "2.1.22-alpha.0",
|
||||||
"@sentry/browser": "5.19.1",
|
"@sentry/browser": "5.19.1",
|
||||||
"@spectrum-css/page": "^3.0.1",
|
"@spectrum-css/page": "^3.0.1",
|
||||||
"@spectrum-css/vars": "^3.0.1",
|
"@spectrum-css/vars": "^3.0.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/cli",
|
"name": "@budibase/cli",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"description": "Budibase CLI, for developers, self hosting and migrations.",
|
"description": "Budibase CLI, for developers, self hosting and migrations.",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -26,9 +26,9 @@
|
||||||
"outputPath": "build"
|
"outputPath": "build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "2.1.19-alpha.0",
|
"@budibase/backend-core": "2.1.22-alpha.0",
|
||||||
"@budibase/string-templates": "2.1.19-alpha.0",
|
"@budibase/string-templates": "2.1.22-alpha.0",
|
||||||
"@budibase/types": "2.1.19-alpha.0",
|
"@budibase/types": "2.1.22-alpha.0",
|
||||||
"axios": "0.21.2",
|
"axios": "0.21.2",
|
||||||
"chalk": "4.1.0",
|
"chalk": "4.1.0",
|
||||||
"cli-progress": "3.11.2",
|
"cli-progress": "3.11.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/client",
|
"name": "@budibase/client",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"module": "dist/budibase-client.js",
|
"module": "dist/budibase-client.js",
|
||||||
"main": "dist/budibase-client.js",
|
"main": "dist/budibase-client.js",
|
||||||
|
@ -19,9 +19,9 @@
|
||||||
"dev:builder": "rollup -cw"
|
"dev:builder": "rollup -cw"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "2.1.19-alpha.0",
|
"@budibase/bbui": "2.1.22-alpha.0",
|
||||||
"@budibase/frontend-core": "2.1.19-alpha.0",
|
"@budibase/frontend-core": "2.1.22-alpha.0",
|
||||||
"@budibase/string-templates": "2.1.19-alpha.0",
|
"@budibase/string-templates": "2.1.22-alpha.0",
|
||||||
"@spectrum-css/button": "^3.0.3",
|
"@spectrum-css/button": "^3.0.3",
|
||||||
"@spectrum-css/card": "^3.0.3",
|
"@spectrum-css/card": "^3.0.3",
|
||||||
"@spectrum-css/divider": "^1.0.3",
|
"@spectrum-css/divider": "^1.0.3",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/frontend-core",
|
"name": "@budibase/frontend-core",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"description": "Budibase frontend core libraries used in builder and client",
|
"description": "Budibase frontend core libraries used in builder and client",
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"svelte": "src/index.js",
|
"svelte": "src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "2.1.19-alpha.0",
|
"@budibase/bbui": "2.1.22-alpha.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"svelte": "^3.46.2"
|
"svelte": "^3.46.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/sdk",
|
"name": "@budibase/sdk",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"description": "Budibase Public API SDK",
|
"description": "Budibase Public API SDK",
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/server",
|
"name": "@budibase/server",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"description": "Budibase Web Server",
|
"description": "Budibase Web Server",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -77,11 +77,11 @@
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apidevtools/swagger-parser": "10.0.3",
|
"@apidevtools/swagger-parser": "10.0.3",
|
||||||
"@budibase/backend-core": "2.1.19-alpha.0",
|
"@budibase/backend-core": "2.1.22-alpha.0",
|
||||||
"@budibase/client": "2.1.19-alpha.0",
|
"@budibase/client": "2.1.22-alpha.0",
|
||||||
"@budibase/pro": "2.1.19-alpha.0",
|
"@budibase/pro": "2.1.22-alpha.0",
|
||||||
"@budibase/string-templates": "2.1.19-alpha.0",
|
"@budibase/string-templates": "2.1.22-alpha.0",
|
||||||
"@budibase/types": "2.1.19-alpha.0",
|
"@budibase/types": "2.1.22-alpha.0",
|
||||||
"@bull-board/api": "3.7.0",
|
"@bull-board/api": "3.7.0",
|
||||||
"@bull-board/koa": "3.9.4",
|
"@bull-board/koa": "3.9.4",
|
||||||
"@elastic/elasticsearch": "7.10.0",
|
"@elastic/elasticsearch": "7.10.0",
|
||||||
|
|
|
@ -5,6 +5,8 @@ import { isQsTrue } from "../../utilities"
|
||||||
|
|
||||||
export async function exportAppDump(ctx: any) {
|
export async function exportAppDump(ctx: any) {
|
||||||
let { appId, excludeRows } = ctx.query
|
let { appId, excludeRows } = ctx.query
|
||||||
|
// remove the 120 second limit for the request
|
||||||
|
ctx.req.setTimeout(0)
|
||||||
const appName = decodeURI(ctx.query.appname)
|
const appName = decodeURI(ctx.query.appname)
|
||||||
excludeRows = isQsTrue(excludeRows)
|
excludeRows = isQsTrue(excludeRows)
|
||||||
const backupIdentifier = `${appName}-export-${new Date().getTime()}.tar.gz`
|
const backupIdentifier = `${appName}-export-${new Date().getTime()}.tar.gz`
|
||||||
|
|
|
@ -1094,12 +1094,12 @@
|
||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@budibase/backend-core@2.1.19-alpha.0":
|
"@budibase/backend-core@2.1.22-alpha.0":
|
||||||
version "2.1.19-alpha.0"
|
version "2.1.22-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.19-alpha.0.tgz#ec30bd3bf9453631259bf121154515214d21a4b8"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.22-alpha.0.tgz#53d72dd843abe6d8b69bbd663aa159fc5ff49060"
|
||||||
integrity sha512-C49h4scGRNAFFZR3jaX7pX3WbZfSP07Rg1bYEPqI7MaivRh0SUNWv9r5rGz2eqy+LbwAtPEV5GDjsT2mAaaNNg==
|
integrity sha512-RHOfd9Qc7ubww9tU8SJspxgCw4zoX8eOmjAsc//7QwgKGwjLBCPngLMmjYYI22J3iZFeaZbir2eRf8HkI4THDw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/types" "2.1.19-alpha.0"
|
"@budibase/types" "2.1.22-alpha.0"
|
||||||
"@shopify/jest-koa-mocks" "5.0.1"
|
"@shopify/jest-koa-mocks" "5.0.1"
|
||||||
"@techpass/passport-openidconnect" "0.3.2"
|
"@techpass/passport-openidconnect" "0.3.2"
|
||||||
aws-sdk "2.1030.0"
|
aws-sdk "2.1030.0"
|
||||||
|
@ -1181,13 +1181,13 @@
|
||||||
svelte-flatpickr "^3.2.3"
|
svelte-flatpickr "^3.2.3"
|
||||||
svelte-portal "^1.0.0"
|
svelte-portal "^1.0.0"
|
||||||
|
|
||||||
"@budibase/pro@2.1.19-alpha.0":
|
"@budibase/pro@2.1.22-alpha.0":
|
||||||
version "2.1.19-alpha.0"
|
version "2.1.22-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.19-alpha.0.tgz#3a7f6a900c1760a54d969a48cc7eed5ee105c5a4"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.22-alpha.0.tgz#5a3edb233271798e0c28ae665b54e3772af79f08"
|
||||||
integrity sha512-gerMHUyRxpbKFhP6aAJCgd0I6Ntf5da8aOWogi9pPsRRF60qFojiIl3fFIDRi/esdOpGOa2i8Y28f1+vOzB4pg==
|
integrity sha512-tBPgJ5VQdq81PG9QxKvALL6eaWxzCLQARuXoLQu9J2apwYw5SfkVNlH43BWwRpkAHhTVLQl0VFORikBjncBWjA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "2.1.19-alpha.0"
|
"@budibase/backend-core" "2.1.22-alpha.0"
|
||||||
"@budibase/types" "2.1.19-alpha.0"
|
"@budibase/types" "2.1.22-alpha.0"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
bull "4.10.1"
|
bull "4.10.1"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
|
@ -1211,10 +1211,10 @@
|
||||||
svelte-apexcharts "^1.0.2"
|
svelte-apexcharts "^1.0.2"
|
||||||
svelte-flatpickr "^3.1.0"
|
svelte-flatpickr "^3.1.0"
|
||||||
|
|
||||||
"@budibase/types@2.1.19-alpha.0":
|
"@budibase/types@2.1.22-alpha.0":
|
||||||
version "2.1.19-alpha.0"
|
version "2.1.22-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.19-alpha.0.tgz#1e4367feeccef10d3f64edd5ea6df7d0af362d98"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.22-alpha.0.tgz#51c72726bff7b6af3096509e55d9ba006aac3c3e"
|
||||||
integrity sha512-iFb8GLT59nRGa5e2LWEat7dIIKzwi76ioJ6ng96NjW6VD5aGFU7X76TjdFg2Wb2OM9fahnDKV/O2BUCewMj3Pg==
|
integrity sha512-fA+GsnyJqT4O78A9OhQTPje5yaL+RMvG23grJ+WSIUkZ+uRO83a29O7rBOFE4P4FldbsPEw1qHgt+e1wWrR+Uw==
|
||||||
|
|
||||||
"@bull-board/api@3.7.0":
|
"@bull-board/api@3.7.0":
|
||||||
version "3.7.0"
|
version "3.7.0"
|
||||||
|
@ -9813,9 +9813,9 @@ loader-runner@^4.2.0:
|
||||||
integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==
|
integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==
|
||||||
|
|
||||||
loader-utils@^2.0.0:
|
loader-utils@^2.0.0:
|
||||||
version "2.0.2"
|
version "2.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129"
|
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.3.tgz#d4b15b8504c63d1fc3f2ade52d41bc8459d6ede1"
|
||||||
integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==
|
integrity sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==
|
||||||
dependencies:
|
dependencies:
|
||||||
big.js "^5.2.2"
|
big.js "^5.2.2"
|
||||||
emojis-list "^3.0.0"
|
emojis-list "^3.0.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/string-templates",
|
"name": "@budibase/string-templates",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"description": "Handlebars wrapper for Budibase templating.",
|
"description": "Handlebars wrapper for Budibase templating.",
|
||||||
"main": "src/index.cjs",
|
"main": "src/index.cjs",
|
||||||
"module": "dist/bundle.mjs",
|
"module": "dist/bundle.mjs",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/types",
|
"name": "@budibase/types",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"description": "Budibase types",
|
"description": "Budibase types",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|
|
@ -3,4 +3,5 @@ import { Document } from "../document"
|
||||||
export interface Role extends Document {
|
export interface Role extends Document {
|
||||||
permissionId: string
|
permissionId: string
|
||||||
inherits: string
|
inherits: string
|
||||||
|
permissions: { [key: string]: string[] }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/worker",
|
"name": "@budibase/worker",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "2.1.19-alpha.0",
|
"version": "2.1.22-alpha.0",
|
||||||
"description": "Budibase background service",
|
"description": "Budibase background service",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -36,10 +36,10 @@
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "2.1.19-alpha.0",
|
"@budibase/backend-core": "2.1.22-alpha.0",
|
||||||
"@budibase/pro": "2.1.19-alpha.0",
|
"@budibase/pro": "2.1.22-alpha.0",
|
||||||
"@budibase/string-templates": "2.1.19-alpha.0",
|
"@budibase/string-templates": "2.1.22-alpha.0",
|
||||||
"@budibase/types": "2.1.19-alpha.0",
|
"@budibase/types": "2.1.22-alpha.0",
|
||||||
"@koa/router": "8.0.8",
|
"@koa/router": "8.0.8",
|
||||||
"@sentry/node": "6.17.7",
|
"@sentry/node": "6.17.7",
|
||||||
"@techpass/passport-openidconnect": "0.3.2",
|
"@techpass/passport-openidconnect": "0.3.2",
|
||||||
|
|
|
@ -291,12 +291,12 @@
|
||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@budibase/backend-core@2.1.19-alpha.0":
|
"@budibase/backend-core@2.1.22-alpha.0":
|
||||||
version "2.1.19-alpha.0"
|
version "2.1.22-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.19-alpha.0.tgz#ec30bd3bf9453631259bf121154515214d21a4b8"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.22-alpha.0.tgz#53d72dd843abe6d8b69bbd663aa159fc5ff49060"
|
||||||
integrity sha512-C49h4scGRNAFFZR3jaX7pX3WbZfSP07Rg1bYEPqI7MaivRh0SUNWv9r5rGz2eqy+LbwAtPEV5GDjsT2mAaaNNg==
|
integrity sha512-RHOfd9Qc7ubww9tU8SJspxgCw4zoX8eOmjAsc//7QwgKGwjLBCPngLMmjYYI22J3iZFeaZbir2eRf8HkI4THDw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/types" "2.1.19-alpha.0"
|
"@budibase/types" "2.1.22-alpha.0"
|
||||||
"@shopify/jest-koa-mocks" "5.0.1"
|
"@shopify/jest-koa-mocks" "5.0.1"
|
||||||
"@techpass/passport-openidconnect" "0.3.2"
|
"@techpass/passport-openidconnect" "0.3.2"
|
||||||
aws-sdk "2.1030.0"
|
aws-sdk "2.1030.0"
|
||||||
|
@ -328,22 +328,22 @@
|
||||||
uuid "8.3.2"
|
uuid "8.3.2"
|
||||||
zlib "1.0.5"
|
zlib "1.0.5"
|
||||||
|
|
||||||
"@budibase/pro@2.1.19-alpha.0":
|
"@budibase/pro@2.1.22-alpha.0":
|
||||||
version "2.1.19-alpha.0"
|
version "2.1.22-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.19-alpha.0.tgz#3a7f6a900c1760a54d969a48cc7eed5ee105c5a4"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.22-alpha.0.tgz#5a3edb233271798e0c28ae665b54e3772af79f08"
|
||||||
integrity sha512-gerMHUyRxpbKFhP6aAJCgd0I6Ntf5da8aOWogi9pPsRRF60qFojiIl3fFIDRi/esdOpGOa2i8Y28f1+vOzB4pg==
|
integrity sha512-tBPgJ5VQdq81PG9QxKvALL6eaWxzCLQARuXoLQu9J2apwYw5SfkVNlH43BWwRpkAHhTVLQl0VFORikBjncBWjA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "2.1.19-alpha.0"
|
"@budibase/backend-core" "2.1.22-alpha.0"
|
||||||
"@budibase/types" "2.1.19-alpha.0"
|
"@budibase/types" "2.1.22-alpha.0"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
bull "4.10.1"
|
bull "4.10.1"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@budibase/types@2.1.19-alpha.0":
|
"@budibase/types@2.1.22-alpha.0":
|
||||||
version "2.1.19-alpha.0"
|
version "2.1.22-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.19-alpha.0.tgz#1e4367feeccef10d3f64edd5ea6df7d0af362d98"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.22-alpha.0.tgz#51c72726bff7b6af3096509e55d9ba006aac3c3e"
|
||||||
integrity sha512-iFb8GLT59nRGa5e2LWEat7dIIKzwi76ioJ6ng96NjW6VD5aGFU7X76TjdFg2Wb2OM9fahnDKV/O2BUCewMj3Pg==
|
integrity sha512-fA+GsnyJqT4O78A9OhQTPje5yaL+RMvG23grJ+WSIUkZ+uRO83a29O7rBOFE4P4FldbsPEw1qHgt+e1wWrR+Uw==
|
||||||
|
|
||||||
"@cspotcode/source-map-consumer@0.8.0":
|
"@cspotcode/source-map-consumer@0.8.0":
|
||||||
version "0.8.0"
|
version "0.8.0"
|
||||||
|
|
Loading…
Reference in New Issue