@budibase/worker 3.20.2 → 3.20.3

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.20.2",
4
+ "version": "3.20.3",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -109,5 +109,5 @@
109
109
  }
110
110
  }
111
111
  },
112
- "gitHead": "3582592cff6b755c0e6f5cf7d04f32be18d7a9a8"
112
+ "gitHead": "801ead90230ea40bd93f89daa92e2998310627ea"
113
113
  }
@@ -416,7 +416,7 @@ export const onboardUsers = async (
416
416
  }
417
417
 
418
418
  let createdPasswords: Record<string, string> = {}
419
- const users: User[] = ctx.request.body.map(invite => {
419
+ const users = ctx.request.body.map<User>(invite => {
420
420
  const password = generatePassword(12)
421
421
  createdPasswords[invite.email] = password
422
422
 
@@ -424,8 +424,8 @@ export const onboardUsers = async (
424
424
  email: invite.email,
425
425
  password,
426
426
  forceResetPassword: true,
427
- roles: invite.userInfo.apps,
428
- admin: invite.userInfo.admin,
427
+ roles: invite.userInfo.apps || {},
428
+ admin: { global: !!invite.userInfo.admin },
429
429
  builder: invite.userInfo.builder,
430
430
  tenantId: tenancy.getTenantId(),
431
431
  }
@@ -1,9 +1,9 @@
1
1
  import { events, tenancy, users as usersCore } from "@budibase/backend-core"
2
2
  import {
3
+ EmailTemplatePurpose,
3
4
  InviteUserRequest,
4
5
  InviteUsersRequest,
5
6
  InviteUsersResponse,
6
- EmailTemplatePurpose,
7
7
  } from "@budibase/types"
8
8
  import { sendEmail } from "../../utilities/email"
9
9
 
@@ -42,7 +42,7 @@ export async function invite(
42
42
  userInfo = {}
43
43
  }
44
44
  userInfo.tenantId = tenantId
45
- const opts: any = {
45
+ const opts = {
46
46
  subject: "{{ company }} platform invitation",
47
47
  info: userInfo,
48
48
  }