@budibase/worker 2.13.14 → 2.13.15
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/__mocks__/node-fetch.ts +1 -0
- package/package.json +6 -6
- package/src/api/controllers/global/self.ts +1 -0
- package/src/api/controllers/global/users.ts +10 -21
- package/src/api/index.ts +2 -0
- package/src/api/routes/global/templates.ts +1 -0
- package/src/api/routes/global/tests/auth.spec.ts +1 -0
- package/src/api/routes/global/tests/configs.spec.ts +1 -0
- package/src/api/routes/global/tests/email.spec.ts +1 -0
- package/src/api/routes/global/tests/license.spec.ts +1 -0
- package/src/api/routes/global/tests/realEmail.spec.ts +1 -0
- package/src/api/routes/system/tests/status.spec.ts +1 -0
- package/src/index.ts +3 -2
- package/src/tests/TestConfiguration.ts +3 -0
- package/src/tests/jestSetup.ts +1 -0
- package/src/tests/mocks/index.ts +1 -0
- package/src/utilities/email.ts +1 -0
package/__mocks__/node-fetch.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/worker",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.13.
|
|
4
|
+
"version": "2.13.15",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"author": "Budibase",
|
|
38
38
|
"license": "GPL-3.0",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@budibase/backend-core": "2.13.
|
|
41
|
-
"@budibase/pro": "2.13.
|
|
42
|
-
"@budibase/string-templates": "2.13.
|
|
43
|
-
"@budibase/types": "2.13.
|
|
40
|
+
"@budibase/backend-core": "2.13.15",
|
|
41
|
+
"@budibase/pro": "2.13.15",
|
|
42
|
+
"@budibase/string-templates": "2.13.15",
|
|
43
|
+
"@budibase/types": "2.13.15",
|
|
44
44
|
"@koa/router": "8.0.8",
|
|
45
45
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
46
46
|
"@types/global-agent": "2.1.1",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "8ada75c2f51c6ddff52676944b0d6e9395ea1c0b"
|
|
111
111
|
}
|
|
@@ -120,28 +120,17 @@ export const adminUser = async (
|
|
|
120
120
|
)
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
const user: User = {
|
|
124
|
-
email: email,
|
|
125
|
-
password: password,
|
|
126
|
-
createdAt: Date.now(),
|
|
127
|
-
roles: {},
|
|
128
|
-
builder: {
|
|
129
|
-
global: true,
|
|
130
|
-
},
|
|
131
|
-
admin: {
|
|
132
|
-
global: true,
|
|
133
|
-
},
|
|
134
|
-
tenantId,
|
|
135
|
-
ssoId,
|
|
136
|
-
}
|
|
137
123
|
try {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
124
|
+
const finalUser = await userSdk.db.createAdminUser(
|
|
125
|
+
email,
|
|
126
|
+
password,
|
|
127
|
+
tenantId,
|
|
128
|
+
{
|
|
129
|
+
ssoId,
|
|
130
|
+
hashPassword,
|
|
131
|
+
requirePassword,
|
|
132
|
+
}
|
|
133
|
+
)
|
|
145
134
|
|
|
146
135
|
// events
|
|
147
136
|
let account: CloudAccount | undefined
|
package/src/api/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as controller from "../../controllers/global/templates"
|
|
|
3
3
|
import { TemplatePurpose, TemplateType } from "../../../constants"
|
|
4
4
|
import { auth as authCore } from "@budibase/backend-core"
|
|
5
5
|
import Joi from "joi"
|
|
6
|
+
|
|
6
7
|
const { adminOnly, joiValidator } = authCore
|
|
7
8
|
|
|
8
9
|
const router: Router = new Router()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// mock the email system
|
|
2
2
|
jest.mock("nodemailer")
|
|
3
3
|
import { TestConfiguration, structures, mocks } from "../../../../tests"
|
|
4
|
+
|
|
4
5
|
mocks.email.mock()
|
|
5
6
|
import { events } from "@budibase/backend-core"
|
|
6
7
|
import { GetPublicSettingsResponse, Config, ConfigType } from "@budibase/types"
|
package/src/index.ts
CHANGED
|
@@ -18,13 +18,14 @@ import {
|
|
|
18
18
|
timers,
|
|
19
19
|
redis,
|
|
20
20
|
} from "@budibase/backend-core"
|
|
21
|
+
|
|
21
22
|
db.init()
|
|
22
|
-
import Koa from "koa"
|
|
23
23
|
import koaBody from "koa-body"
|
|
24
24
|
import http from "http"
|
|
25
25
|
import api from "./api"
|
|
26
26
|
|
|
27
27
|
const koaSession = require("koa-session")
|
|
28
|
+
|
|
28
29
|
import { userAgent } from "koa-useragent"
|
|
29
30
|
|
|
30
31
|
import destroyable from "server-destroy"
|
|
@@ -40,7 +41,7 @@ if (coreEnv.ENABLE_SSO_MAINTENANCE_MODE) {
|
|
|
40
41
|
// this will setup http and https proxies form env variables
|
|
41
42
|
bootstrap()
|
|
42
43
|
|
|
43
|
-
const app: Application = new
|
|
44
|
+
const app: Application = new Application()
|
|
44
45
|
|
|
45
46
|
app.keys = ["secret", "key"]
|
|
46
47
|
|
|
@@ -7,10 +7,13 @@ mocks.licenses.init(mocks.pro)
|
|
|
7
7
|
mocks.licenses.useUnlimited()
|
|
8
8
|
|
|
9
9
|
import * as dbConfig from "../db"
|
|
10
|
+
|
|
10
11
|
dbConfig.init()
|
|
11
12
|
import env from "../environment"
|
|
12
13
|
import * as controllers from "./controllers"
|
|
14
|
+
|
|
13
15
|
const supertest = require("supertest")
|
|
16
|
+
|
|
14
17
|
import { Config } from "../constants"
|
|
15
18
|
import {
|
|
16
19
|
users,
|
package/src/tests/jestSetup.ts
CHANGED
package/src/tests/mocks/index.ts
CHANGED
package/src/utilities/email.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { processString } from "@budibase/string-templates"
|
|
|
6
6
|
import { User, SendEmailOpts, SMTPInnerConfig } from "@budibase/types"
|
|
7
7
|
import { configs, cache } from "@budibase/backend-core"
|
|
8
8
|
import ical from "ical-generator"
|
|
9
|
+
|
|
9
10
|
const nodemailer = require("nodemailer")
|
|
10
11
|
|
|
11
12
|
const TEST_MODE = env.ENABLE_EMAIL_TEST_MODE && env.isDev()
|