@budibase/frontend-core 2.11.31 → 2.11.33
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,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.33",
|
|
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": "2.11.
|
|
10
|
-
"@budibase/shared-core": "2.11.
|
|
9
|
+
"@budibase/bbui": "2.11.33",
|
|
10
|
+
"@budibase/shared-core": "2.11.33",
|
|
11
11
|
"dayjs": "^1.10.8",
|
|
12
12
|
"lodash": "^4.17.21",
|
|
13
13
|
"socket.io-client": "^4.6.1",
|
|
14
14
|
"svelte": "^3.46.2"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "68771f42f956392fcd330c10fc4ffc13d83aa5e9"
|
|
17
17
|
}
|
package/src/api/user.js
CHANGED
|
@@ -10,24 +10,28 @@ export const buildUserEndpoints = API => ({
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Gets a list of users in the current tenant.
|
|
13
|
-
* @param {string}
|
|
14
|
-
* @param {
|
|
13
|
+
* @param {string} bookmark The page to retrieve
|
|
14
|
+
* @param {object} query search filters for lookup by user (all operators not supported).
|
|
15
15
|
* @param {string} appId Facilitate app/role based user searching
|
|
16
|
-
* @param {boolean}
|
|
16
|
+
* @param {boolean} paginate Allow the disabling of pagination
|
|
17
|
+
* @param {number} limit How many users to retrieve in a single search
|
|
17
18
|
*/
|
|
18
|
-
searchUsers: async ({
|
|
19
|
+
searchUsers: async ({ paginate, bookmark, query, appId, limit } = {}) => {
|
|
19
20
|
const opts = {}
|
|
20
|
-
if (
|
|
21
|
-
opts.
|
|
21
|
+
if (bookmark) {
|
|
22
|
+
opts.bookmark = bookmark
|
|
22
23
|
}
|
|
23
|
-
if (
|
|
24
|
-
opts.
|
|
24
|
+
if (query) {
|
|
25
|
+
opts.query = query
|
|
25
26
|
}
|
|
26
27
|
if (appId) {
|
|
27
28
|
opts.appId = appId
|
|
28
29
|
}
|
|
29
|
-
if (typeof
|
|
30
|
-
opts.
|
|
30
|
+
if (typeof paginate === "boolean") {
|
|
31
|
+
opts.paginate = paginate
|
|
32
|
+
}
|
|
33
|
+
if (limit) {
|
|
34
|
+
opts.limit = limit
|
|
31
35
|
}
|
|
32
36
|
return await API.post({
|
|
33
37
|
url: `/api/global/users/search`,
|
package/src/fetch/UserFetch.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { get } from "svelte/store"
|
|
2
2
|
import DataFetch from "./DataFetch.js"
|
|
3
3
|
import { TableNames } from "../constants"
|
|
4
|
+
import { LuceneUtils } from "../utils"
|
|
4
5
|
|
|
5
6
|
export default class UserFetch extends DataFetch {
|
|
6
7
|
constructor(opts) {
|
|
@@ -27,16 +28,25 @@ export default class UserFetch extends DataFetch {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
async getData() {
|
|
31
|
+
const { limit, paginate } = this.options
|
|
30
32
|
const { cursor, query } = get(this.store)
|
|
33
|
+
let finalQuery
|
|
34
|
+
// convert old format to new one - we now allow use of the lucene format
|
|
35
|
+
const { appId, paginated, ...rest } = query
|
|
36
|
+
if (!LuceneUtils.hasFilters(query) && rest.email) {
|
|
37
|
+
finalQuery = { string: { email: rest.email } }
|
|
38
|
+
} else {
|
|
39
|
+
finalQuery = rest
|
|
40
|
+
}
|
|
31
41
|
try {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
const opts = {
|
|
43
|
+
bookmark: cursor,
|
|
44
|
+
query: finalQuery,
|
|
45
|
+
appId: appId,
|
|
46
|
+
paginate: paginated || paginate,
|
|
47
|
+
limit,
|
|
48
|
+
}
|
|
49
|
+
const res = await this.API.searchUsers(opts)
|
|
40
50
|
return {
|
|
41
51
|
rows: res?.data || [],
|
|
42
52
|
hasNextPage: res?.hasNextPage || false,
|