@budibase/worker 3.2.11 → 3.2.16
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.
|
|
4
|
+
"version": "3.2.16",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"author": "Budibase",
|
|
39
39
|
"license": "GPL-3.0",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@budibase/backend-core": "3.2.
|
|
42
|
-
"@budibase/pro": "3.2.
|
|
43
|
-
"@budibase/shared-core": "3.2.
|
|
44
|
-
"@budibase/string-templates": "3.2.
|
|
45
|
-
"@budibase/types": "3.2.
|
|
41
|
+
"@budibase/backend-core": "3.2.16",
|
|
42
|
+
"@budibase/pro": "3.2.16",
|
|
43
|
+
"@budibase/shared-core": "3.2.16",
|
|
44
|
+
"@budibase/string-templates": "3.2.16",
|
|
45
|
+
"@budibase/types": "3.2.16",
|
|
46
46
|
"@koa/router": "13.1.0",
|
|
47
47
|
"@techpass/passport-openidconnect": "0.3.3",
|
|
48
48
|
"@types/global-agent": "2.1.1",
|
|
@@ -50,8 +50,9 @@
|
|
|
50
50
|
"bcrypt": "5.1.0",
|
|
51
51
|
"bcryptjs": "2.4.3",
|
|
52
52
|
"bull": "4.10.1",
|
|
53
|
-
"dd-trace": "5.
|
|
53
|
+
"dd-trace": "5.26.0",
|
|
54
54
|
"dotenv": "8.6.0",
|
|
55
|
+
"email-validator": "^2.0.4",
|
|
55
56
|
"global-agent": "3.0.0",
|
|
56
57
|
"ical-generator": "4.1.0",
|
|
57
58
|
"joi": "17.6.0",
|
|
@@ -114,5 +115,5 @@
|
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
},
|
|
117
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "04d0c02f70b21e01e3a98f5ab8751a6865b29a6c"
|
|
118
119
|
}
|
|
@@ -40,6 +40,7 @@ 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"
|
|
43
44
|
import crypto from "crypto"
|
|
44
45
|
|
|
45
46
|
const MAX_USERS_UPLOAD_LIMIT = 1000
|
|
@@ -300,6 +301,10 @@ export const find = async (ctx: any) => {
|
|
|
300
301
|
|
|
301
302
|
export const tenantUserLookup = async (ctx: any) => {
|
|
302
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
|
+
}
|
|
303
308
|
const user = await userSdk.core.getFirstPlatformUser(id)
|
|
304
309
|
if (user) {
|
|
305
310
|
ctx.body = user
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
jest.mock("nodemailer")
|
|
2
|
-
import { TestConfiguration
|
|
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)
|