@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/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.2",
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.2",
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.5.0",
62
- "@swc/core": "^1.3.25",
63
- "@swc/jest": "^0.2.24",
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.0",
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.5.0",
79
- "jest-environment-node": "29.5.0",
80
- "jest-serial-runner": "^1.2.1",
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": "107f65ab79b5127a171a5b358cdf6a2184be5588"
104
+ "gitHead": "c45402b5f5d2207047d9595f624851a256c4e541"
106
105
  }
package/scripts/test.sh CHANGED
@@ -8,6 +8,6 @@ then
8
8
  jest --coverage --runInBand --forceExit
9
9
  else
10
10
  # --maxWorkers performs better in development
11
- echo "jest --coverage --forceExit"
12
- jest --coverage --forceExit
11
+ echo "jest --coverage --detectOpenHandles"
12
+ jest --coverage --detectOpenHandles
13
13
  fi
@@ -1,5 +1,5 @@
1
- const { flatten } = require("lodash")
2
- const { cloneDeep } = require("lodash/fp")
1
+ import flatten from "lodash/flatten"
2
+ import cloneDeep from "lodash/fp/cloneDeep"
3
3
 
4
4
  export type RoleHierarchy = {
5
5
  permissionId: string
@@ -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
- const { cloneDeep } = require("lodash/fp")
6
+ import cloneDeep from "lodash/fp/cloneDeep"
7
7
 
8
8
  export const BUILTIN_ROLE_IDS = {
9
9
  ADMIN: "ADMIN",
@@ -1,4 +1,4 @@
1
- import { cloneDeep } from "lodash"
1
+ import cloneDeep from "lodash/cloneDeep"
2
2
  import * as permissions from "../permissions"
3
3
  import { BUILTIN_ROLE_IDS } from "../roles"
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { Feature, License, Quotas } from "@budibase/types"
2
- import _ from "lodash"
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 = _.cloneDeep(UNLIMITED_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 = _.cloneDeep(UNLIMITED_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 _ from "lodash"
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 _.sample(
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 _.sample(Object.values(AccountSSOProvider)) as AccountSSOProvider
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 } = _.assign(
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 _ from "lodash"
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 _.sample(Object.values(SSOProviderType)) as SSOProviderType
50
+ return sample(Object.values(SSOProviderType)) as SSOProviderType
51
51
  }
52
52
 
53
53
  export function ssoProfile(user?: User): SSOProfile {