@budibase/worker 2.4.42-alpha.0 → 2.4.42-alpha.1
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": "2.4.42-alpha.
|
|
4
|
+
"version": "2.4.42-alpha.1",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"author": "Budibase",
|
|
37
37
|
"license": "GPL-3.0",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@budibase/backend-core": "2.4.42-alpha.
|
|
40
|
-
"@budibase/pro": "2.4.
|
|
41
|
-
"@budibase/string-templates": "2.4.42-alpha.
|
|
42
|
-
"@budibase/types": "2.4.42-alpha.
|
|
39
|
+
"@budibase/backend-core": "2.4.42-alpha.1",
|
|
40
|
+
"@budibase/pro": "2.4.42-alpha.0",
|
|
41
|
+
"@budibase/string-templates": "2.4.42-alpha.1",
|
|
42
|
+
"@budibase/types": "2.4.42-alpha.1",
|
|
43
43
|
"@koa/router": "8.0.8",
|
|
44
44
|
"@sentry/node": "6.17.7",
|
|
45
45
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"typescript": "4.7.3",
|
|
102
102
|
"update-dotenv": "1.1.1"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "7991f321a1339c06893c340f960b510321bf2554"
|
|
105
105
|
}
|
|
@@ -58,4 +58,17 @@ describe("/api/global/tenants", () => {
|
|
|
58
58
|
expect(res.body).toEqual(config.adminOnlyResponse())
|
|
59
59
|
})
|
|
60
60
|
})
|
|
61
|
+
|
|
62
|
+
describe("GET /api/system/tenants/:tenantId/info", () => {
|
|
63
|
+
it("allows retrieving information about the tenant", async () => {
|
|
64
|
+
const user1 = await config.createTenant()
|
|
65
|
+
const res = await config.api.tenants.info(user1.tenantId)
|
|
66
|
+
expect(res.body.exists).toEqual(true)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it("check a tenant that doesn't exist", async () => {
|
|
70
|
+
const res = await config.api.tenants.info("cannot-exist-tenantid")
|
|
71
|
+
expect(res.body.exists).toEqual(false)
|
|
72
|
+
})
|
|
73
|
+
})
|
|
61
74
|
})
|
|
@@ -74,3 +74,10 @@ async function removeTenantUsers(tenantId: string) {
|
|
|
74
74
|
throw err
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
export async function tenantInfo(tenantId: string) {
|
|
79
|
+
const globalDbName = tenancy.getGlobalDBName(tenantId)
|
|
80
|
+
return {
|
|
81
|
+
exists: await dbCore.dbExists(globalDbName),
|
|
82
|
+
}
|
|
83
|
+
}
|
package/src/tests/api/tenants.ts
CHANGED
|
@@ -2,8 +2,10 @@ import TestConfiguration from "../TestConfiguration"
|
|
|
2
2
|
import { TestAPI, TestAPIOpts } from "./base"
|
|
3
3
|
|
|
4
4
|
export class TenantAPI extends TestAPI {
|
|
5
|
+
config: TestConfiguration
|
|
5
6
|
constructor(config: TestConfiguration) {
|
|
6
7
|
super(config)
|
|
8
|
+
this.config = config
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
delete = (tenantId: string, opts?: TestAPIOpts) => {
|
|
@@ -12,4 +14,11 @@ export class TenantAPI extends TestAPI {
|
|
|
12
14
|
.set(opts?.headers)
|
|
13
15
|
.expect(opts?.status ? opts.status : 204)
|
|
14
16
|
}
|
|
17
|
+
|
|
18
|
+
info = (tenantId: string) => {
|
|
19
|
+
return this.request
|
|
20
|
+
.get(`/api/system/tenants/${tenantId}/info`)
|
|
21
|
+
.set(this.config.defaultHeaders())
|
|
22
|
+
.expect(200)
|
|
23
|
+
}
|
|
15
24
|
}
|