@budibase/frontend-core 3.18.14 → 3.19.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 +2 -2
- package/src/api/groups.ts +0 -24
- package/src/api/plugins.ts +1 -1
- package/src/api/user.ts +37 -39
- package/src/components/UserAvatar.svelte +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"description": "Budibase frontend core libraries used in builder and client",
|
|
5
5
|
"author": "Budibase",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"shortid": "2.2.15",
|
|
18
18
|
"socket.io-client": "^4.7.5"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "72863c719173848d3128cbef9556a0af09708c20"
|
|
21
21
|
}
|
package/src/api/groups.ts
CHANGED
|
@@ -19,8 +19,6 @@ export interface GroupEndpoints {
|
|
|
19
19
|
removeUsersFromGroup: (groupId: string, userIds: string[]) => Promise<void>
|
|
20
20
|
addAppsToGroup: (groupId: string, appArray: object[]) => Promise<void>
|
|
21
21
|
removeAppsFromGroup: (groupId: string, appArray: object[]) => Promise<void>
|
|
22
|
-
addGroupAppBuilder: (groupId: string, appId: string) => Promise<void>
|
|
23
|
-
removeGroupAppBuilder: (groupId: string, appId: string) => Promise<void>
|
|
24
22
|
bulkAddUsersFromCsv: (
|
|
25
23
|
groupId: string,
|
|
26
24
|
csvContent: string
|
|
@@ -172,28 +170,6 @@ export const buildGroupsEndpoints = (API: BaseAPIClient): GroupEndpoints => {
|
|
|
172
170
|
)
|
|
173
171
|
},
|
|
174
172
|
|
|
175
|
-
/**
|
|
176
|
-
* Add app builder to group
|
|
177
|
-
* @param groupId The group to update
|
|
178
|
-
* @param appId The app id where the builder will be added
|
|
179
|
-
*/
|
|
180
|
-
addGroupAppBuilder: async (groupId, appId) => {
|
|
181
|
-
return await API.post({
|
|
182
|
-
url: `/api/global/groups/${groupId}/app/${appId}/builder`,
|
|
183
|
-
})
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Remove app builder from group
|
|
188
|
-
* @param groupId The group to update
|
|
189
|
-
* @param appId The app id where the builder will be removed
|
|
190
|
-
*/
|
|
191
|
-
removeGroupAppBuilder: async (groupId, appId) => {
|
|
192
|
-
return await API.delete({
|
|
193
|
-
url: `/api/global/groups/${groupId}/app/${appId}/builder`,
|
|
194
|
-
})
|
|
195
|
-
},
|
|
196
|
-
|
|
197
173
|
/**
|
|
198
174
|
* Bulk add users to group from CSV content
|
|
199
175
|
* @param groupId The group to update
|
package/src/api/plugins.ts
CHANGED
package/src/api/user.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
DeleteInviteUsersRequest,
|
|
13
13
|
DeleteInviteUsersResponse,
|
|
14
14
|
DeleteUserResponse,
|
|
15
|
+
EditUserPermissionsResponse,
|
|
15
16
|
FetchUsersResponse,
|
|
16
17
|
FindUserResponse,
|
|
17
18
|
GetUserInvitesResponse,
|
|
@@ -22,7 +23,6 @@ import {
|
|
|
22
23
|
SearchUsersRequest,
|
|
23
24
|
SearchUsersResponse,
|
|
24
25
|
UnsavedUser,
|
|
25
|
-
UpdateInviteRequest,
|
|
26
26
|
UpdateInviteResponse,
|
|
27
27
|
UpdateSelfMetadataRequest,
|
|
28
28
|
UpdateSelfMetadataResponse,
|
|
@@ -59,17 +59,20 @@ export interface UserEndpoints {
|
|
|
59
59
|
users: UnsavedUser[],
|
|
60
60
|
groups: any[]
|
|
61
61
|
) => Promise<BulkUserCreated | undefined>
|
|
62
|
-
|
|
62
|
+
addWorkspaceIdToInvite: (
|
|
63
63
|
code: string,
|
|
64
|
-
|
|
64
|
+
role: string
|
|
65
65
|
) => Promise<UpdateInviteResponse>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
removeWorkspaceIdFromInvite: (code: string) => Promise<UpdateInviteResponse>
|
|
67
|
+
addUserToWorkspace: (
|
|
68
|
+
userId: string,
|
|
69
|
+
role: string,
|
|
70
|
+
rev: string
|
|
71
|
+
) => Promise<SaveUserResponse>
|
|
72
|
+
removeUserFromWorkspace: (
|
|
70
73
|
userId: string,
|
|
71
|
-
|
|
72
|
-
) => Promise<
|
|
74
|
+
rev: string
|
|
75
|
+
) => Promise<SaveUserResponse>
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
export const buildUserEndpoints = (API: BaseAPIClient): UserEndpoints => ({
|
|
@@ -188,14 +191,31 @@ export const buildUserEndpoints = (API: BaseAPIClient): UserEndpoints => ({
|
|
|
188
191
|
})
|
|
189
192
|
},
|
|
190
193
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
addWorkspaceIdToInvite: async (code, role) => {
|
|
195
|
+
return await API.post<void, UpdateInviteResponse>({
|
|
196
|
+
url: `/api/global/users/invite/${code}/${role}`,
|
|
197
|
+
})
|
|
198
|
+
},
|
|
199
|
+
removeWorkspaceIdFromInvite: async code => {
|
|
200
|
+
return await API.delete<void, UpdateInviteResponse>({
|
|
201
|
+
url: `/api/global/users/invite/${code}`,
|
|
202
|
+
})
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
addUserToWorkspace: async (userId, role, rev) => {
|
|
206
|
+
return await API.post<EditUserPermissionsResponse, SaveUserResponse>({
|
|
207
|
+
url: `/api/global/users/${userId}/permission/${role}`,
|
|
208
|
+
body: {
|
|
209
|
+
_rev: rev,
|
|
210
|
+
},
|
|
211
|
+
})
|
|
212
|
+
},
|
|
213
|
+
removeUserFromWorkspace: async (userId, rev) => {
|
|
214
|
+
return await API.delete<EditUserPermissionsResponse, SaveUserResponse>({
|
|
215
|
+
url: `/api/global/users/${userId}/permission`,
|
|
216
|
+
body: {
|
|
217
|
+
_rev: rev,
|
|
218
|
+
},
|
|
199
219
|
})
|
|
200
220
|
},
|
|
201
221
|
|
|
@@ -259,28 +279,6 @@ export const buildUserEndpoints = (API: BaseAPIClient): UserEndpoints => ({
|
|
|
259
279
|
return res.userCount
|
|
260
280
|
},
|
|
261
281
|
|
|
262
|
-
/**
|
|
263
|
-
* Adds a per app builder to the selected app
|
|
264
|
-
* @param userId The id of the user to add as a builder
|
|
265
|
-
* @param appId the applications id
|
|
266
|
-
*/
|
|
267
|
-
addAppBuilder: async (userId, appId) => {
|
|
268
|
-
return await API.post({
|
|
269
|
-
url: `/api/global/users/${userId}/app/${appId}/builder`,
|
|
270
|
-
})
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Removes a per app builder to the selected app
|
|
275
|
-
* @param userId The id of the user to remove as a builder
|
|
276
|
-
* @param appId the applications id
|
|
277
|
-
*/
|
|
278
|
-
removeAppBuilder: async (userId, appId) => {
|
|
279
|
-
return await API.delete({
|
|
280
|
-
url: `/api/global/users/${userId}/app/${appId}/builder`,
|
|
281
|
-
})
|
|
282
|
-
},
|
|
283
|
-
|
|
284
282
|
/**
|
|
285
283
|
* Gets the account holder of the current tenant
|
|
286
284
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { helpers } from "@budibase/shared-core"
|
|
4
4
|
import type { User } from "@budibase/types"
|
|
5
5
|
|
|
6
|
-
export let user: User
|
|
6
|
+
export let user: User | undefined
|
|
7
7
|
export let size: "XS" | "S" | "M" = "S"
|
|
8
8
|
export let tooltipPosition: TooltipPosition = TooltipPosition.Top
|
|
9
9
|
export let showTooltip: boolean = true
|