@budibase/worker 3.2.7 → 3.2.14

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "3.2.7",
4
+ "version": "3.2.14",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -16,6 +16,7 @@
16
16
  "build": "node ../../scripts/build.js",
17
17
  "postbuild": "copyfiles -f ../../yarn.lock ./dist/",
18
18
  "check:types": "tsc -p tsconfig.json --noEmit --paths null --target es2020",
19
+ "check:dependencies": "node ../../scripts/depcheck.js",
19
20
  "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput",
20
21
  "run:docker": "node dist/index.js",
21
22
  "debug": "yarn build && node --expose-gc --inspect=9223 dist/index.js",
@@ -37,22 +38,25 @@
37
38
  "author": "Budibase",
38
39
  "license": "GPL-3.0",
39
40
  "dependencies": {
40
- "@budibase/backend-core": "3.2.7",
41
- "@budibase/pro": "3.2.7",
42
- "@budibase/string-templates": "3.2.7",
43
- "@budibase/types": "3.2.7",
44
- "@koa/router": "8.0.8",
41
+ "@budibase/backend-core": "3.2.14",
42
+ "@budibase/pro": "3.2.14",
43
+ "@budibase/shared-core": "3.2.14",
44
+ "@budibase/string-templates": "3.2.14",
45
+ "@budibase/types": "3.2.14",
46
+ "@koa/router": "13.1.0",
45
47
  "@techpass/passport-openidconnect": "0.3.3",
46
48
  "@types/global-agent": "2.1.1",
47
- "aws-sdk": "2.1030.0",
49
+ "aws-sdk": "2.1692.0",
48
50
  "bcrypt": "5.1.0",
49
51
  "bcryptjs": "2.4.3",
50
52
  "bull": "4.10.1",
51
- "dd-trace": "5.2.0",
53
+ "dd-trace": "5.26.0",
52
54
  "dotenv": "8.6.0",
55
+ "email-validator": "^2.0.4",
53
56
  "global-agent": "3.0.0",
54
57
  "ical-generator": "4.1.0",
55
58
  "joi": "17.6.0",
59
+ "jsonwebtoken": "9.0.2",
56
60
  "knex": "2.4.2",
57
61
  "koa": "2.13.4",
58
62
  "koa-body": "4.2.0",
@@ -69,16 +73,19 @@
69
73
  "passport-local": "1.0.0",
70
74
  "pouchdb": "7.3.0",
71
75
  "pouchdb-all-dbs": "1.1.1",
72
- "server-destroy": "1.0.1"
76
+ "server-destroy": "1.0.1",
77
+ "uuid": "^8.3.2"
73
78
  },
74
79
  "devDependencies": {
80
+ "@jest/types": "^29.6.3",
75
81
  "@swc/core": "1.3.71",
76
82
  "@swc/jest": "0.2.27",
77
83
  "@types/jest": "29.5.5",
78
84
  "@types/jsonwebtoken": "9.0.3",
79
85
  "@types/koa": "2.13.4",
80
- "@types/koa__router": "8.0.8",
86
+ "@types/koa__router": "12.0.4",
81
87
  "@types/lodash": "4.14.200",
88
+ "@types/node": "^22.9.0",
82
89
  "@types/node-fetch": "2.6.4",
83
90
  "@types/server-destroy": "1.0.1",
84
91
  "@types/supertest": "2.0.14",
@@ -87,6 +94,7 @@
87
94
  "nock": "^13.5.4",
88
95
  "nodemon": "2.0.15",
89
96
  "rimraf": "3.0.2",
97
+ "superagent": "^10.1.1",
90
98
  "supertest": "6.3.3",
91
99
  "timekeeper": "2.2.0",
92
100
  "typescript": "5.5.2",
@@ -107,5 +115,5 @@
107
115
  }
108
116
  }
109
117
  },
110
- "gitHead": "fbfab71c1e93d79cf64736a218bf08fddde0ccd0"
118
+ "gitHead": "eb0e18ce77436d0171f08cf0bfc9a66d72ee1ee2"
111
119
  }
@@ -40,6 +40,8 @@ import {
40
40
  import { checkAnyUserExists } from "../../../utilities/users"
41
41
  import { isEmailConfigured } from "../../../utilities/email"
42
42
  import { BpmStatusKey, BpmStatusValue, utils } from "@budibase/shared-core"
43
+ import emailValidator from "email-validator"
44
+ import crypto from "crypto"
43
45
 
44
46
  const MAX_USERS_UPLOAD_LIMIT = 1000
45
47
 
@@ -299,6 +301,10 @@ export const find = async (ctx: any) => {
299
301
 
300
302
  export const tenantUserLookup = async (ctx: any) => {
301
303
  const id = ctx.params.id
304
+ // is email, check its valid
305
+ if (id.includes("@") && !emailValidator.validate(id)) {
306
+ ctx.throw(400, `${id} is not a valid email address to lookup.`)
307
+ }
302
308
  const user = await userSdk.core.getFirstPlatformUser(id)
303
309
  if (user) {
304
310
  ctx.body = user
@@ -1,5 +1,5 @@
1
1
  jest.mock("nodemailer")
2
- import { TestConfiguration, mocks } from "../../../../tests"
2
+ import { TestConfiguration } from "../../../../tests"
3
3
  import { events } from "@budibase/backend-core"
4
4
 
5
5
  describe("/api/global/self", () => {
@@ -39,7 +39,6 @@ describe("/api/global/self", () => {
39
39
  const dbUser = (await config.getUser(user.email))!
40
40
 
41
41
  user._rev = dbUser._rev
42
- user.dayPassRecordedAt = mocks.date.MOCK_DATE.toISOString()
43
42
  expect(res.body._id).toBe(user._id)
44
43
  expect(events.user.updated).toHaveBeenCalledTimes(1)
45
44
  expect(events.user.updated).toHaveBeenCalledWith(dbUser)
@@ -62,7 +61,6 @@ describe("/api/global/self", () => {
62
61
  const dbUser = (await config.getUser(user.email))!
63
62
 
64
63
  user._rev = dbUser._rev
65
- user.dayPassRecordedAt = mocks.date.MOCK_DATE.toISOString()
66
64
  expect(dbUser.onboardedAt).toBe("2023-03-07T14:10:54.869Z")
67
65
  expect(dbUser.freeTrialConfirmedAt).toBe("2024-03-17T14:10:54.869Z")
68
66
  expect(res.body._id).toBe(user._id)
package/src/index.ts CHANGED
@@ -24,7 +24,6 @@ import {
24
24
  db.init()
25
25
  import koaBody from "koa-body"
26
26
  import http from "http"
27
- import bson from "bson"
28
27
  import api from "./api"
29
28
 
30
29
  const koaSession = require("koa-session")
@@ -101,10 +100,6 @@ export default server.listen(parseInt(env.PORT || "4002"), async () => {
101
100
  }
102
101
  console.log(startupLog)
103
102
 
104
- if (coreEnv.BSON_BUFFER_SIZE) {
105
- bson.setInternalBufferSize(coreEnv.BSON_BUFFER_SIZE)
106
- }
107
-
108
103
  await initPro()
109
104
  await redis.clients.init()
110
105
  features.init()