@budibase/worker 2.22.13 → 2.22.15
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/worker",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.22.
|
|
4
|
+
"version": "2.22.15",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"author": "Budibase",
|
|
38
38
|
"license": "GPL-3.0",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@budibase/backend-core": "2.22.
|
|
41
|
-
"@budibase/pro": "2.22.
|
|
42
|
-
"@budibase/string-templates": "2.22.
|
|
43
|
-
"@budibase/types": "2.22.
|
|
40
|
+
"@budibase/backend-core": "2.22.15",
|
|
41
|
+
"@budibase/pro": "2.22.15",
|
|
42
|
+
"@budibase/string-templates": "2.22.15",
|
|
43
|
+
"@budibase/types": "2.22.15",
|
|
44
44
|
"@koa/router": "8.0.8",
|
|
45
45
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
46
46
|
"@types/global-agent": "2.1.1",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "5ec5e990b3e96a2720470158c4cc8cf10926b637"
|
|
112
112
|
}
|
|
@@ -229,7 +229,7 @@ export const search = async (ctx: Ctx<SearchUsersRequest>) => {
|
|
|
229
229
|
}
|
|
230
230
|
// Validate we aren't trying to search on any illegal fields
|
|
231
231
|
if (!userSdk.core.isSupportedUserSearch(body.query)) {
|
|
232
|
-
ctx.throw(400, "Can only search by string.email or
|
|
232
|
+
ctx.throw(400, "Can only search by string.email, equal._id or oneOf._id")
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -649,6 +649,24 @@ describe("/api/global/users", () => {
|
|
|
649
649
|
expect(response.body.data[0]._id).toBe(user._id)
|
|
650
650
|
})
|
|
651
651
|
|
|
652
|
+
it("should be able to search by oneOf _id", async () => {
|
|
653
|
+
const [user, user2, user3] = await Promise.all([
|
|
654
|
+
config.createUser(),
|
|
655
|
+
config.createUser(),
|
|
656
|
+
config.createUser(),
|
|
657
|
+
])
|
|
658
|
+
const response = await config.api.users.searchUsers({
|
|
659
|
+
query: { oneOf: { _id: [user._id, user2._id] } },
|
|
660
|
+
})
|
|
661
|
+
expect(response.body.data.length).toBe(2)
|
|
662
|
+
const foundUserIds = response.body.data.map((user: User) => user._id)
|
|
663
|
+
expect(foundUserIds).toContain(user._id)
|
|
664
|
+
expect(foundUserIds).toContain(user2._id)
|
|
665
|
+
expect(
|
|
666
|
+
response.body.data.find((user: User) => user._id === user3._id)
|
|
667
|
+
).toBeUndefined()
|
|
668
|
+
})
|
|
669
|
+
|
|
652
670
|
it("should be able to search by _id with numeric prefixing", async () => {
|
|
653
671
|
const user = await config.createUser()
|
|
654
672
|
const response = await config.api.users.searchUsers({
|