@budibase/frontend-core 1.0.212-alpha.7 → 1.0.212-alpha.8

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/api/user.js +28 -0
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "1.0.212-alpha.7",
3
+ "version": "1.0.212-alpha.8",
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.0.212-alpha.7",
9
+ "@budibase/bbui": "^1.0.212-alpha.8",
10
10
  "lodash": "^4.17.21",
11
11
  "svelte": "^3.46.2"
12
12
  },
13
- "gitHead": "548b2c1a9fa92fb4e9bef9f3cef05bb9097af701"
13
+ "gitHead": "5087b886af43b54834d16f0266130d01e8f19a10"
14
14
  }
package/src/api/user.js CHANGED
@@ -8,6 +8,34 @@ export const buildUserEndpoints = API => ({
8
8
  })
9
9
  },
10
10
 
11
+ /**
12
+ * Gets a list of users in the current tenant.
13
+ * @param {string} page The page to retrieve
14
+ * @param {string} search The starts with string to search username/email by.
15
+ */
16
+ searchUsers: async ({ page, search } = {}) => {
17
+ const opts = {}
18
+ if (page) {
19
+ opts.page = page
20
+ }
21
+ if (search) {
22
+ opts.search = search
23
+ }
24
+ return await API.post({
25
+ url: `/api/global/users/search`,
26
+ body: opts,
27
+ })
28
+ },
29
+
30
+ /**
31
+ * Get a single user by ID.
32
+ */
33
+ getUser: async userId => {
34
+ return await API.get({
35
+ url: `/api/global/users/${userId}`,
36
+ })
37
+ },
38
+
11
39
  /**
12
40
  * Creates a user for an app.
13
41
  * @param user the user to create