@gooddata/sdk-backend-mockingbird 11.51.0 → 11.52.0-alpha.3

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.
@@ -14,9 +14,11 @@ export declare function recordedAccessControlFactory(implConfig: RecordedBackend
14
14
  */
15
15
  export declare class RecordedWorkspaceUsersQuery implements IWorkspaceUsersQuery {
16
16
  private config;
17
+ private options;
17
18
  constructor(config: RecordedBackendConfig);
18
- withOptions(_options: IWorkspaceUsersQueryOptions): IWorkspaceUsersQuery;
19
+ withOptions(options: IWorkspaceUsersQueryOptions): IWorkspaceUsersQuery;
19
20
  queryAll(): Promise<IWorkspaceUser[]>;
20
21
  query(): Promise<IWorkspaceUsersQueryResult>;
22
+ private matchingUsers;
21
23
  }
22
24
  //# sourceMappingURL=userManagement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"userManagement.d.ts","sourceRoot":"","sources":["../../src/recordedBackend/userManagement.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAE9B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAA4B,KAAK,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAEjG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,qBAAqB,GAAG,yBAAyB,CAOpG;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,qBAAqB,GAClC,8BAA8B,CAgBhC;AAED;;GAEG;AACH,qBAAa,2BAA4B,YAAW,oBAAoB;IACpE,OAAO,CAAC,MAAM,CAA6B;IAE3C,YAAY,MAAM,EAAE,qBAAqB,EAExC;IAED,WAAW,CAAC,QAAQ,EAAE,2BAA2B,GAAG,oBAAoB,CAEvE;IAED,QAAQ,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAGpC;IAED,KAAK,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAG3C;CACJ"}
1
+ {"version":3,"file":"userManagement.d.ts","sourceRoot":"","sources":["../../src/recordedBackend/userManagement.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAE9B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAA4B,KAAK,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAEjG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,qBAAqB,GAAG,yBAAyB,CAOpG;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,qBAAqB,GAClC,8BAA8B,CAgBhC;AAED;;GAEG;AACH,qBAAa,2BAA4B,YAAW,oBAAoB;IACpE,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,OAAO,CAAmC;IAElD,YAAY,MAAM,EAAE,qBAAqB,EAExC;IAED,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,oBAAoB,CAGtE;IAED,QAAQ,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAEpC;IAED,KAAK,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAG3C;IAED,OAAO,CAAC,aAAa;CAYxB"}
@@ -1,4 +1,4 @@
1
- // (C) 2019-2025 GoodData Corporation
1
+ // (C) 2019-2026 GoodData Corporation
2
2
  import { InMemoryPaging } from "@gooddata/sdk-backend-base";
3
3
  /**
4
4
  * @internal
@@ -34,18 +34,27 @@ export function recordedAccessControlFactory(implConfig) {
34
34
  */
35
35
  export class RecordedWorkspaceUsersQuery {
36
36
  config = {};
37
+ options = {};
37
38
  constructor(config) {
38
39
  this.config = config;
39
40
  }
40
- withOptions(_options) {
41
+ withOptions(options) {
42
+ this.options = options ?? {};
41
43
  return this;
42
44
  }
43
45
  queryAll() {
44
- const result = this.config?.userManagement?.users?.users ?? [];
45
- return Promise.resolve(result);
46
+ return Promise.resolve(this.matchingUsers());
46
47
  }
47
48
  query() {
48
- const result = this.config.userManagement?.users?.users ?? [];
49
- return Promise.resolve(new InMemoryPaging(result));
49
+ const { limit, offset } = this.options;
50
+ return Promise.resolve(new InMemoryPaging(this.matchingUsers(), limit, offset));
51
+ }
52
+ matchingUsers() {
53
+ const users = this.config.userManagement?.users?.users ?? [];
54
+ const search = this.options.search?.toLowerCase();
55
+ if (!search) {
56
+ return users;
57
+ }
58
+ return users.filter((user) => [user.fullName, user.login, user.email].some((value) => value?.toLowerCase().includes(search)));
50
59
  }
51
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-backend-mockingbird",
3
- "version": "11.51.0",
3
+ "version": "11.52.0-alpha.3",
4
4
  "description": "Mock GoodData Backend SPI implementation",
5
5
  "license": "MIT",
6
6
  "author": "GoodData",
@@ -25,10 +25,10 @@
25
25
  "ts-invariant": "0.10.3",
26
26
  "tslib": "2.8.1",
27
27
  "uuid": "11.1.1",
28
- "@gooddata/sdk-backend-base": "11.51.0",
29
- "@gooddata/sdk-model": "11.51.0",
30
- "@gooddata/util": "11.51.0",
31
- "@gooddata/sdk-backend-spi": "11.51.0"
28
+ "@gooddata/sdk-backend-base": "11.52.0-alpha.3",
29
+ "@gooddata/sdk-backend-spi": "11.52.0-alpha.3",
30
+ "@gooddata/util": "11.52.0-alpha.3",
31
+ "@gooddata/sdk-model": "11.52.0-alpha.3"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@microsoft/api-documenter": "^7.17.0",
@@ -52,9 +52,9 @@
52
52
  "oxlint-tsgolint": "0.15.0",
53
53
  "typescript": "5.9.3",
54
54
  "vitest": "4.1.8",
55
- "@gooddata/eslint-config": "11.51.0",
56
- "@gooddata/oxlint-config": "11.51.0",
57
- "@gooddata/reference-workspace": "11.51.0"
55
+ "@gooddata/eslint-config": "11.52.0-alpha.3",
56
+ "@gooddata/reference-workspace": "11.52.0-alpha.3",
57
+ "@gooddata/oxlint-config": "11.52.0-alpha.3"
58
58
  },
59
59
  "scripts": {
60
60
  "_phase:build": "npm run build",