@budibase/worker 3.18.0 → 3.18.2

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,7 +1,7 @@
1
- import { Config } from "@jest/types"
1
+ import { Config } from "jest"
2
2
  import * as fs from "fs"
3
3
 
4
- const config: Config.InitialOptions = {
4
+ const config: Config = {
5
5
  globalSetup: "./../../globalSetup.ts",
6
6
  setupFiles: ["./src/tests/jestEnv.ts"],
7
7
  setupFilesAfterEnv: ["./src/tests/jestSetup.ts"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "3.18.0",
4
+ "version": "3.18.2",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -72,10 +72,6 @@
72
72
  "yaml": "^2.8.0"
73
73
  },
74
74
  "devDependencies": {
75
- "@jest/types": "^29.6.3",
76
- "@swc/core": "1.3.71",
77
- "@swc/jest": "0.2.27",
78
- "@types/jest": "29.5.5",
79
75
  "@types/jsonwebtoken": "9.0.3",
80
76
  "@types/koa__router": "12.0.4",
81
77
  "@types/lodash": "4.14.200",
@@ -86,7 +82,6 @@
86
82
  "@types/supertest": "2.0.14",
87
83
  "@types/uuid": "8.3.4",
88
84
  "cheerio": "^1.0.0",
89
- "jest": "29.7.0",
90
85
  "maildev": "^2.2.1",
91
86
  "nock": "^13.5.4",
92
87
  "nodemon": "2.0.15",
@@ -114,5 +109,5 @@
114
109
  }
115
110
  }
116
111
  },
117
- "gitHead": "255f35eea6023bbc035d9dee8c56ba3e600c6b89"
112
+ "gitHead": "43d59f5579dd910575d8aebefb40fae25570c05d"
118
113
  }
@@ -673,7 +673,7 @@ export async function configChecklist(ctx: Ctx<void, ConfigChecklistResponse>) {
673
673
  apps: {
674
674
  checked: apps.length > 0,
675
675
  label: "Create your first app",
676
- link: "/builder/portal/apps",
676
+ link: "/builder/portal/workspaces",
677
677
  },
678
678
  smtp: {
679
679
  checked: !!smtpConfig,
@@ -17,10 +17,14 @@ import nock from "nock"
17
17
  import * as jwt from "jsonwebtoken"
18
18
 
19
19
  function getAuthCookie(response: Response) {
20
- return response.headers["set-cookie"]
21
- .find((s: string) => s.startsWith(`${constants.Cookie.Auth}=`))
22
- .split("=")[1]
23
- .split(";")[0]
20
+ const cookies = response.headers["set-cookie"]
21
+ if (!cookies) throw new Error("No cookies found")
22
+ const cookieArray = Array.isArray(cookies) ? cookies : [cookies]
23
+ const authCookie = cookieArray.find((s: string) =>
24
+ s.startsWith(`${constants.Cookie.Auth}=`)
25
+ )
26
+ if (!authCookie) throw new Error("No auth cookie found")
27
+ return authCookie.split("=")[1].split(";")[0]
24
28
  }
25
29
 
26
30
  const expectSetAuthCookie = (response: Response) => {
@@ -302,9 +306,10 @@ describe("/api/global/auth", () => {
302
306
  const res = await config.api.configs.getOIDCConfig(configId)
303
307
 
304
308
  expect(res.status).toBe(302)
305
- const location: string = res.get("location")
309
+ const location = res.get("location")
310
+ expect(location).toBeDefined()
306
311
  expect(
307
- location.startsWith(
312
+ location!.startsWith(
308
313
  `http://example.com/auth?response_type=code&client_id=clientId&redirect_uri=http%3A%2F%2Flocalhost%3A10000%2Fapi%2Fglobal%2Fauth%2F${config.tenantId}%2Foidc%2Fcallback&scope=openid%20profile%20email%20offline_access`
309
314
  )
310
315
  ).toBe(true)
@@ -356,7 +361,7 @@ describe("/api/global/auth", () => {
356
361
  expect(events.auth.login).toHaveBeenCalledWith("oidc", email)
357
362
  expect(events.auth.login).toHaveBeenCalledTimes(1)
358
363
  expect(res.status).toBe(302)
359
- const location: string = res.get("location")
364
+ const location = res.get("location")
360
365
  expect(location).toBe("/")
361
366
  expectSetAuthCookie(res)
362
367
  })