@budibase/backend-core 2.8.29-alpha.2 → 2.8.29-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jest.config.js +9 -4
- package/dist/jest.config.js.map +1 -1
- package/dist/package.json +11 -12
- package/dist/src/security/permissions.d.ts +27 -1
- package/dist/src/security/permissions.js +7 -4
- package/dist/src/security/permissions.js.map +1 -1
- package/dist/src/security/roles.js +7 -4
- package/dist/src/security/roles.js.map +1 -1
- package/dist/tests/core/utilities/mocks/licenses.js +3 -3
- package/dist/tests/core/utilities/mocks/licenses.js.map +1 -1
- package/dist/tests/core/utilities/structures/accounts.js +3 -3
- package/dist/tests/core/utilities/structures/accounts.js.map +1 -1
- package/dist/tests/core/utilities/structures/scim.js +1 -5
- package/dist/tests/core/utilities/structures/scim.js.map +1 -1
- package/dist/tests/core/utilities/structures/sso.js +2 -2
- package/dist/tests/core/utilities/structures/sso.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/jest.config.ts +0 -2
- package/package.json +11 -12
- package/scripts/test.sh +2 -2
- package/src/security/permissions.ts +2 -2
- package/src/security/roles.ts +1 -1
- package/src/security/tests/permissions.spec.ts +1 -1
- package/tests/core/utilities/mocks/licenses.ts +3 -3
- package/tests/core/utilities/structures/accounts.ts +3 -5
- package/tests/core/utilities/structures/scim.ts +4 -5
- package/tests/core/utilities/structures/sso.ts +2 -2
package/jest.config.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Config } from "@jest/types"
|
|
2
|
-
const preset = require("ts-jest/jest-preset")
|
|
3
2
|
|
|
4
3
|
const baseConfig: Config.InitialProjectOptions = {
|
|
5
|
-
...preset,
|
|
6
4
|
preset: "@trendyol/jest-testcontainers",
|
|
7
5
|
setupFiles: ["./tests/jestEnv.ts"],
|
|
8
6
|
setupFilesAfterEnv: ["./tests/jestSetup.ts"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/backend-core",
|
|
3
|
-
"version": "2.8.29-alpha.
|
|
3
|
+
"version": "2.8.29-alpha.3",
|
|
4
4
|
"description": "Budibase backend core libraries used in server and worker",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@budibase/nano": "10.1.2",
|
|
24
24
|
"@budibase/pouchdb-replication-stream": "1.2.10",
|
|
25
|
-
"@budibase/types": "2.8.29-alpha.
|
|
26
|
-
"@shopify/jest-koa-mocks": "5.0.1",
|
|
25
|
+
"@budibase/types": "2.8.29-alpha.3",
|
|
27
26
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
28
27
|
"aws-cloudfront-sign": "2.2.0",
|
|
29
28
|
"aws-sdk": "2.1030.0",
|
|
@@ -58,12 +57,13 @@
|
|
|
58
57
|
"uuid": "8.3.2"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
|
-
"@jest/test-sequencer": "29.
|
|
62
|
-
"@
|
|
63
|
-
"@swc/
|
|
60
|
+
"@jest/test-sequencer": "29.6.2",
|
|
61
|
+
"@shopify/jest-koa-mocks": "5.1.1",
|
|
62
|
+
"@swc/core": "1.3.71",
|
|
63
|
+
"@swc/jest": "0.2.27",
|
|
64
64
|
"@trendyol/jest-testcontainers": "^2.1.1",
|
|
65
65
|
"@types/chance": "1.1.3",
|
|
66
|
-
"@types/jest": "29.5.
|
|
66
|
+
"@types/jest": "29.5.3",
|
|
67
67
|
"@types/koa": "2.13.4",
|
|
68
68
|
"@types/lodash": "4.14.180",
|
|
69
69
|
"@types/node": "14.18.20",
|
|
@@ -75,15 +75,14 @@
|
|
|
75
75
|
"@types/uuid": "8.3.4",
|
|
76
76
|
"chance": "1.1.8",
|
|
77
77
|
"ioredis-mock": "8.7.0",
|
|
78
|
-
"jest": "29.
|
|
79
|
-
"jest-environment-node": "29.
|
|
80
|
-
"jest-serial-runner": "
|
|
78
|
+
"jest": "29.6.2",
|
|
79
|
+
"jest-environment-node": "29.6.2",
|
|
80
|
+
"jest-serial-runner": "1.2.1",
|
|
81
81
|
"koa": "2.13.4",
|
|
82
82
|
"nodemon": "2.0.16",
|
|
83
83
|
"pino-pretty": "10.0.0",
|
|
84
84
|
"pouchdb-adapter-memory": "7.2.2",
|
|
85
85
|
"timekeeper": "2.2.0",
|
|
86
|
-
"ts-jest": "29.0.5",
|
|
87
86
|
"ts-node": "10.8.1",
|
|
88
87
|
"tsconfig-paths": "4.0.0",
|
|
89
88
|
"typescript": "4.7.3"
|
|
@@ -102,5 +101,5 @@
|
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
},
|
|
105
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "c45402b5f5d2207047d9595f624851a256c4e541"
|
|
106
105
|
}
|
package/scripts/test.sh
CHANGED
package/src/security/roles.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { prefixRoleID, getRoleParams, DocumentType, SEPARATOR } from "../db"
|
|
|
3
3
|
import { getAppDB } from "../context"
|
|
4
4
|
import { doWithDB } from "../db"
|
|
5
5
|
import { Screen, Role as RoleDoc } from "@budibase/types"
|
|
6
|
-
|
|
6
|
+
import cloneDeep from "lodash/fp/cloneDeep"
|
|
7
7
|
|
|
8
8
|
export const BUILTIN_ROLE_IDS = {
|
|
9
9
|
ADMIN: "ADMIN",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Feature, License, Quotas } from "@budibase/types"
|
|
2
|
-
import
|
|
2
|
+
import cloneDeep from "lodash/cloneDeep"
|
|
3
3
|
|
|
4
4
|
let CLOUD_FREE_LICENSE: License
|
|
5
5
|
let UNLIMITED_LICENSE: License
|
|
@@ -58,7 +58,7 @@ export const useCloudFree = () => {
|
|
|
58
58
|
// FEATURES
|
|
59
59
|
|
|
60
60
|
const useFeature = (feature: Feature) => {
|
|
61
|
-
const license =
|
|
61
|
+
const license = cloneDeep(UNLIMITED_LICENSE)
|
|
62
62
|
const opts: UseLicenseOpts = {
|
|
63
63
|
features: [feature],
|
|
64
64
|
}
|
|
@@ -97,7 +97,7 @@ export const useSyncAutomations = () => {
|
|
|
97
97
|
// QUOTAS
|
|
98
98
|
|
|
99
99
|
export const setAutomationLogsQuota = (value: number) => {
|
|
100
|
-
const license =
|
|
100
|
+
const license = cloneDeep(UNLIMITED_LICENSE)
|
|
101
101
|
license.quotas.constant.automationLogRetentionDays.value = value
|
|
102
102
|
return useLicense(license)
|
|
103
103
|
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
CreateAccount,
|
|
12
12
|
CreatePassswordAccount,
|
|
13
13
|
} from "@budibase/types"
|
|
14
|
-
import
|
|
14
|
+
import sample from "lodash/sample"
|
|
15
15
|
|
|
16
16
|
export const account = (partial: Partial<Account> = {}): Account => {
|
|
17
17
|
return {
|
|
@@ -46,13 +46,11 @@ export const cloudAccount = (): CloudAccount => {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function providerType(): AccountSSOProviderType {
|
|
49
|
-
return
|
|
50
|
-
Object.values(AccountSSOProviderType)
|
|
51
|
-
) as AccountSSOProviderType
|
|
49
|
+
return sample(Object.values(AccountSSOProviderType)) as AccountSSOProviderType
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
function provider(): AccountSSOProvider {
|
|
55
|
-
return
|
|
53
|
+
return sample(Object.values(AccountSSOProvider)) as AccountSSOProvider
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
export function ssoAccount(account: Account = cloudAccount()): SSOAccount {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ScimCreateGroupRequest, ScimCreateUserRequest } from "@budibase/types"
|
|
2
2
|
import { uuid } from "./common"
|
|
3
3
|
import { generator } from "./generator"
|
|
4
|
-
import _ from "lodash"
|
|
5
4
|
|
|
6
5
|
interface CreateUserRequestFields {
|
|
7
6
|
externalId: string
|
|
@@ -20,10 +19,10 @@ export function createUserRequest(userData?: Partial<CreateUserRequestFields>) {
|
|
|
20
19
|
username: generator.name(),
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
const { externalId, email, firstName, lastName, username } =
|
|
24
|
-
defaultValues,
|
|
25
|
-
userData
|
|
26
|
-
|
|
22
|
+
const { externalId, email, firstName, lastName, username } = {
|
|
23
|
+
...defaultValues,
|
|
24
|
+
...userData,
|
|
25
|
+
}
|
|
27
26
|
|
|
28
27
|
let user: ScimCreateUserRequest = {
|
|
29
28
|
schemas: [
|
|
@@ -15,7 +15,7 @@ import { generator } from "./generator"
|
|
|
15
15
|
import { email, uuid } from "./common"
|
|
16
16
|
import * as shared from "./shared"
|
|
17
17
|
import { user } from "./shared"
|
|
18
|
-
import
|
|
18
|
+
import sample from "lodash/sample"
|
|
19
19
|
|
|
20
20
|
export function OAuth(): OAuth2 {
|
|
21
21
|
return {
|
|
@@ -47,7 +47,7 @@ export function authDetails(userDoc?: User): SSOAuthDetails {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export function providerType(): SSOProviderType {
|
|
50
|
-
return
|
|
50
|
+
return sample(Object.values(SSOProviderType)) as SSOProviderType
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export function ssoProfile(user?: User): SSOProfile {
|