@budibase/frontend-core 1.1.32-alpha.6 → 1.1.32

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.1.32-alpha.6",
3
+ "version": "1.1.32",
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.1.32-alpha.6",
9
+ "@budibase/bbui": "^1.1.32",
10
10
  "lodash": "^4.17.21",
11
11
  "svelte": "^3.46.2"
12
12
  },
13
- "gitHead": "1e5ddf4e78f604e0d82b5e42e2adbba5a4bfa901"
13
+ "gitHead": "900d5de0723c1b7acf218446507d52755fdf7d83"
14
14
  }
package/src/api/index.js CHANGED
@@ -23,7 +23,6 @@ import { buildUserEndpoints } from "./user"
23
23
  import { buildSelfEndpoints } from "./self"
24
24
  import { buildViewEndpoints } from "./views"
25
25
  import { buildLicensingEndpoints } from "./licensing"
26
- import { buildGroupsEndpoints } from "./groups"
27
26
 
28
27
  const defaultAPIClientConfig = {
29
28
  /**
@@ -242,6 +241,5 @@ export const createAPIClient = config => {
242
241
  ...buildViewEndpoints(API),
243
242
  ...buildSelfEndpoints(API),
244
243
  ...buildLicensingEndpoints(API),
245
- ...buildGroupsEndpoints(API),
246
244
  }
247
245
  }
package/src/api/user.js CHANGED
@@ -13,16 +13,13 @@ export const buildUserEndpoints = API => ({
13
13
  * @param {string} page The page to retrieve
14
14
  * @param {string} search The starts with string to search username/email by.
15
15
  */
16
- searchUsers: async ({ page, email, appId } = {}) => {
16
+ searchUsers: async ({ page, search } = {}) => {
17
17
  const opts = {}
18
18
  if (page) {
19
19
  opts.page = page
20
20
  }
21
- if (email) {
22
- opts.email = email
23
- }
24
- if (appId) {
25
- opts.appId = appId
21
+ if (search) {
22
+ opts.search = search
26
23
  }
27
24
  return await API.post({
28
25
  url: `/api/global/users/search`,
@@ -83,20 +80,6 @@ export const buildUserEndpoints = API => ({
83
80
  })
84
81
  },
85
82
 
86
- /**
87
- * Creates multiple users.
88
- * @param users the array of user objects to create
89
- */
90
- createUsers: async ({ users, groups }) => {
91
- return await API.post({
92
- url: "/api/global/users/bulkCreate",
93
- body: {
94
- users,
95
- groups,
96
- },
97
- })
98
- },
99
-
100
83
  /**
101
84
  * Deletes a user from the curernt tenant.
102
85
  * @param userId the ID of the user to delete
@@ -107,19 +90,6 @@ export const buildUserEndpoints = API => ({
107
90
  })
108
91
  },
109
92
 
110
- /**
111
- * Deletes multiple users
112
- * @param userId the ID of the user to delete
113
- */
114
- deleteUsers: async userIds => {
115
- return await API.post({
116
- url: `/api/global/users/bulkDelete`,
117
- body: {
118
- userIds,
119
- },
120
- })
121
- },
122
-
123
93
  /**
124
94
  * Invites a user to the current tenant.
125
95
  * @param email the email address to send the invitation to
@@ -139,25 +109,6 @@ export const buildUserEndpoints = API => ({
139
109
  })
140
110
  },
141
111
 
142
- /**
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
147
- */
148
- inviteUsers: async ({ emails, builder, admin }) => {
149
- return await API.post({
150
- url: "/api/global/users/inviteMultiple",
151
- body: {
152
- emails,
153
- userInfo: {
154
- admin: admin ? { global: true } : undefined,
155
- builder: builder ? { global: true } : undefined,
156
- },
157
- },
158
- })
159
- },
160
-
161
112
  /**
162
113
  * Accepts an invite to join the platform and creates a user.
163
114
  * @param inviteCode the invite code sent in the email
@@ -172,15 +123,4 @@ export const buildUserEndpoints = API => ({
172
123
  },
173
124
  })
174
125
  },
175
-
176
- /**
177
- * Accepts an invite to join the platform and creates a user.
178
- * @param inviteCode the invite code sent in the email
179
- * @param password the password for the newly created user
180
- */
181
- getUserCountByApp: async ({ appId }) => {
182
- return await API.get({
183
- url: `/api/global/users/count/${appId}`,
184
- })
185
- },
186
126
  })
package/src/constants.js CHANGED
@@ -35,7 +35,7 @@ export const OperatorOptions = {
35
35
  label: "Less than",
36
36
  },
37
37
  Contains: {
38
- value: "contains",
38
+ value: "equal",
39
39
  label: "Contains",
40
40
  },
41
41
  NotContains: {
@@ -60,37 +60,6 @@ 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" },
67
- ]
68
-
69
- export const BuilderRoleDescriptions = [
70
- {
71
- value: "appUser",
72
- icon: "User",
73
- label: "App user - Only has access to published apps",
74
- },
75
- {
76
- value: "developer",
77
- icon: "Hammer",
78
- label: "Developer - Access to the app builder",
79
- },
80
- {
81
- value: "admin",
82
- icon: "Draw",
83
- label: "Admin - Full access",
84
- },
85
- ]
86
-
87
- export const PlanType = {
88
- FREE: "free",
89
- TEAM: "team",
90
- BUSINESS: "business",
91
- ENTERPRISE: "enterprise",
92
- }
93
-
94
63
  /**
95
64
  * API version header attached to all requests.
96
65
  * Version changelog:
@@ -99,10 +68,6 @@ export const PlanType = {
99
68
  */
100
69
  export const ApiVersion = "1"
101
70
 
102
- export const Features = {
103
- USER_GROUPS: "userGroups",
104
- }
105
-
106
71
  // Role IDs
107
72
  export const Roles = {
108
73
  ADMIN: "ADMIN",
@@ -111,6 +76,7 @@ export const Roles = {
111
76
  PUBLIC: "PUBLIC",
112
77
  BUILDER: "BUILDER",
113
78
  }
79
+
114
80
  /**
115
81
  * Maximum minimum range for SQL number values
116
82
  */
@@ -103,16 +103,8 @@ export const buildLuceneQuery = filter => {
103
103
  const isHbs =
104
104
  typeof value === "string" && value.match(HBS_REGEX)?.length > 0
105
105
  // Parse all values into correct types
106
- if (type === "datetime") {
107
- // Ensure date value is a valid date and parse into correct format
108
- if (!value) {
109
- return
110
- }
111
- try {
112
- value = new Date(value).toISOString()
113
- } catch (error) {
114
- return
115
- }
106
+ if (type === "datetime" && value) {
107
+ value = new Date(value).toISOString()
116
108
  }
117
109
  if (type === "number" && !Array.isArray(value)) {
118
110
  if (operator === "oneOf") {
package/src/api/groups.js DELETED
@@ -1,40 +0,0 @@
1
- export const buildGroupsEndpoints = API => ({
2
- /**
3
- * Creates a user group.
4
- * @param user the new group to create
5
- */
6
- saveGroup: async group => {
7
- return await API.post({
8
- url: "/api/global/groups",
9
- body: group,
10
- })
11
- },
12
- /**
13
- * Gets all of the user groups
14
- */
15
- getGroups: async () => {
16
- return await API.get({
17
- url: "/api/global/groups",
18
- })
19
- },
20
-
21
- /**
22
- * Gets a group by ID
23
- */
24
- getGroup: async id => {
25
- return await API.get({
26
- url: `/api/global/groups/${id}`,
27
- })
28
- },
29
-
30
- /**
31
- * Deletes a user group
32
- * @param id the id of the config to delete
33
- * @param rev the revision of the config to delete
34
- */
35
- deleteGroup: async ({ id, rev }) => {
36
- return await API.delete({
37
- url: `/api/global/groups/${id}/${rev}`,
38
- })
39
- },
40
- })