@budibase/worker 2.28.6 → 2.29.0

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.28.6",
4
+ "version": "2.29.0",
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.28.6",
41
- "@budibase/pro": "2.28.6",
42
- "@budibase/string-templates": "2.28.6",
43
- "@budibase/types": "2.28.6",
40
+ "@budibase/backend-core": "2.29.0",
41
+ "@budibase/pro": "2.29.0",
42
+ "@budibase/string-templates": "2.29.0",
43
+ "@budibase/types": "2.29.0",
44
44
  "@koa/router": "8.0.8",
45
45
  "@techpass/passport-openidconnect": "0.3.2",
46
46
  "@types/global-agent": "2.1.1",
@@ -109,5 +109,5 @@
109
109
  }
110
110
  }
111
111
  },
112
- "gitHead": "bc810319e03346048231738ec87f781e438e9554"
112
+ "gitHead": "f9bbf84a546b77cd3337a486012cc6110c22fec4"
113
113
  }
@@ -8,3 +8,7 @@ export const save = async (ctx: Ctx<TenantInfo>) => {
8
8
  _rev: response.rev,
9
9
  }
10
10
  }
11
+
12
+ export const get = async (ctx: Ctx) => {
13
+ ctx.body = await tenancy.getTenantInfo(ctx.params.id)
14
+ }
package/src/api/index.ts CHANGED
@@ -129,6 +129,10 @@ const NO_TENANCY_ENDPOINTS = [
129
129
  route: "/api/global/tenant",
130
130
  method: "POST",
131
131
  },
132
+ {
133
+ route: "/api/global/tenant/:id",
134
+ method: "GET",
135
+ },
132
136
  ]
133
137
 
134
138
  // most public endpoints are gets, but some are posts
@@ -18,16 +18,19 @@ function buildTenantInfoValidation() {
18
18
  familyName: OPTIONAL_STRING,
19
19
  budibaseUserId: OPTIONAL_STRING,
20
20
  }).required(),
21
+ hosting: Joi.string().required(),
21
22
  tenantId: Joi.string().required(),
22
23
  }).required()
23
24
  )
24
25
  }
25
26
 
26
- router.post(
27
- "/api/global/tenant",
28
- cloudRestricted,
29
- buildTenantInfoValidation(),
30
- controller.save
31
- )
27
+ router
28
+ .post(
29
+ "/api/global/tenant",
30
+ cloudRestricted,
31
+ buildTenantInfoValidation(),
32
+ controller.save
33
+ )
34
+ .get("/api/global/tenant/:id", controller.get)
32
35
 
33
36
  export default router
@@ -1,4 +1,4 @@
1
- import { TenantInfo } from "@budibase/types"
1
+ import { Hosting, TenantInfo } from "@budibase/types"
2
2
  import { TestConfiguration } from "../../../../tests"
3
3
  import { tenancy as _tenancy } from "@budibase/backend-core"
4
4
 
@@ -36,6 +36,7 @@ describe("/api/global/tenant", () => {
36
36
  budibaseUserId: "USER_ID",
37
37
  },
38
38
  tenantId: "tenant123",
39
+ hosting: Hosting.CLOUD,
39
40
  }
40
41
  const response = await config.api.tenants.saveTenantInfo(tenantInfo)
41
42