@budibase/frontend-core 1.2.5 → 1.2.6

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,14 +1,14 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Budibase frontend core libraries used in builder and client",
5
5
  "author": "Budibase",
6
6
  "license": "MPL-2.0",
7
7
  "svelte": "src/index.js",
8
8
  "dependencies": {
9
- "@budibase/bbui": "^1.2.5",
9
+ "@budibase/bbui": "^1.2.6",
10
10
  "lodash": "^4.17.21",
11
11
  "svelte": "^3.46.2"
12
12
  },
13
- "gitHead": "fe1a52ca497fd3440484bab2e91eaad54096f0ce"
13
+ "gitHead": "7aa3a20ecc0f6d0f4617c6e703bf4f6f1998071e"
14
14
  }
package/src/api/user.js CHANGED
@@ -141,20 +141,18 @@ export const buildUserEndpoints = API => ({
141
141
 
142
142
  /**
143
143
  * Invites multiple users to the current tenant.
144
- * @param email An array of email addresses
145
- * @param builder whether the user should be a global builder
146
- * @param admin whether the user should be a global admin
144
+ * @param users An array of users to invite
147
145
  */
148
- inviteUsers: async ({ emails, builder, admin }) => {
146
+ inviteUsers: async users => {
149
147
  return await API.post({
150
- url: "/api/global/users/inviteMultiple",
151
- body: {
152
- emails,
148
+ url: "/api/global/users/multi/invite",
149
+ body: users.map(user => ({
150
+ email: user.email,
153
151
  userInfo: {
154
- admin: admin ? { global: true } : undefined,
155
- builder: builder ? { global: true } : undefined,
152
+ admin: user.admin ? { global: true } : undefined,
153
+ builder: user.admin || user.builder ? { global: true } : undefined,
156
154
  },
157
- },
155
+ })),
158
156
  })
159
157
  },
160
158
 
package/src/constants.js CHANGED
@@ -60,25 +60,31 @@ export const TableNames = {
60
60
  USERS: "ta_users",
61
61
  }
62
62
 
63
- export const BbRoles = [
64
- { label: "App User", value: "appUser" },
65
- { label: "Developer", value: "developer" },
66
- { label: "Admin", value: "admin" },
63
+ export const BudibaseRoles = {
64
+ AppUser: "appUser",
65
+ Developer: "developer",
66
+ Admin: "admin",
67
+ }
68
+
69
+ export const BudibaseRoleOptions = [
70
+ { label: "App User", value: BudibaseRoles.AppUser },
71
+ { label: "Developer", value: BudibaseRoles.Developer },
72
+ { label: "Admin", value: BudibaseRoles.Admin },
67
73
  ]
68
74
 
69
75
  export const BuilderRoleDescriptions = [
70
76
  {
71
- value: "appUser",
77
+ value: BudibaseRoles.AppUser,
72
78
  icon: "User",
73
79
  label: "App user - Only has access to published apps",
74
80
  },
75
81
  {
76
- value: "developer",
82
+ value: BudibaseRoles.Developer,
77
83
  icon: "Hammer",
78
84
  label: "Developer - Access to the app builder",
79
85
  },
80
86
  {
81
- value: "admin",
87
+ value: BudibaseRoles.Admin,
82
88
  icon: "Draw",
83
89
  label: "Admin - Full access",
84
90
  },