@rytass/bpm-core-client 0.4.0 → 0.5.0

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 (64) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/eslint.config.mjs +19 -0
  3. package/jest.config.cts +10 -0
  4. package/package.json +3 -4
  5. package/project.json +66 -0
  6. package/src/lib/api-auth-client.ts +182 -0
  7. package/src/lib/client-config.ts +99 -0
  8. package/src/lib/form/form-api.spec.ts +81 -0
  9. package/src/lib/form/form-api.ts +402 -0
  10. package/src/lib/form/form-rendering.ts +580 -0
  11. package/src/lib/graphql-client.spec.ts +65 -0
  12. package/src/lib/graphql-client.ts +128 -0
  13. package/src/lib/member-api.ts +129 -0
  14. package/src/lib/organization/organization-api.spec.ts +90 -0
  15. package/src/lib/organization/organization-api.ts +711 -0
  16. package/src/lib/template/template-api.spec.ts +88 -0
  17. package/src/lib/template/template-api.ts +894 -0
  18. package/src/lib/workflow/workflow-api.spec.ts +132 -0
  19. package/src/lib/workflow/workflow-api.ts +2124 -0
  20. package/tsconfig.json +27 -0
  21. package/tsconfig.lib.json +16 -0
  22. package/tsconfig.spec.json +16 -0
  23. package/src/index.js +0 -8
  24. package/src/index.js.map +0 -1
  25. package/src/lib/api-auth-client.d.ts +0 -73
  26. package/src/lib/api-auth-client.js +0 -129
  27. package/src/lib/api-auth-client.js.map +0 -1
  28. package/src/lib/client-config.d.ts +0 -81
  29. package/src/lib/client-config.js +0 -63
  30. package/src/lib/client-config.js.map +0 -1
  31. package/src/lib/form/form-api.d.ts +0 -54
  32. package/src/lib/form/form-api.js +0 -240
  33. package/src/lib/form/form-api.js.map +0 -1
  34. package/src/lib/form/form-rendering.d.ts +0 -52
  35. package/src/lib/form/form-rendering.js +0 -341
  36. package/src/lib/form/form-rendering.js.map +0 -1
  37. package/src/lib/form/index.js +0 -6
  38. package/src/lib/form/index.js.map +0 -1
  39. package/src/lib/graphql-client.d.ts +0 -45
  40. package/src/lib/graphql-client.js +0 -101
  41. package/src/lib/graphql-client.js.map +0 -1
  42. package/src/lib/member-api.d.ts +0 -49
  43. package/src/lib/member-api.js +0 -72
  44. package/src/lib/member-api.js.map +0 -1
  45. package/src/lib/organization/index.js +0 -5
  46. package/src/lib/organization/index.js.map +0 -1
  47. package/src/lib/organization/organization-api.d.ts +0 -173
  48. package/src/lib/organization/organization-api.js +0 -394
  49. package/src/lib/organization/organization-api.js.map +0 -1
  50. package/src/lib/template/index.js +0 -5
  51. package/src/lib/template/index.js.map +0 -1
  52. package/src/lib/template/template-api.d.ts +0 -174
  53. package/src/lib/template/template-api.js +0 -469
  54. package/src/lib/template/template-api.js.map +0 -1
  55. package/src/lib/workflow/index.js +0 -5
  56. package/src/lib/workflow/index.js.map +0 -1
  57. package/src/lib/workflow/workflow-api.d.ts +0 -517
  58. package/src/lib/workflow/workflow-api.js +0 -1068
  59. package/src/lib/workflow/workflow-api.js.map +0 -1
  60. /package/src/{index.d.ts → index.ts} +0 -0
  61. /package/src/lib/form/{index.d.ts → index.ts} +0 -0
  62. /package/src/lib/organization/{index.d.ts → index.ts} +0 -0
  63. /package/src/lib/template/{index.d.ts → index.ts} +0 -0
  64. /package/src/lib/workflow/{index.d.ts → index.ts} +0 -0
@@ -1,45 +0,0 @@
1
- /**
2
- * Sends a single GraphQL operation to the BPM host and returns the typed data.
3
- *
4
- * Uses the standard Fetch API with `credentials: 'include'`, so any
5
- * HTTP-only session cookie issued by the host's `POST /auth/login` endpoint
6
- * flows back automatically on subsequent calls.
7
- *
8
- * The endpoint URL is resolved by {@link readGraphQlEndpoint} — set
9
- * `NEXT_PUBLIC_API_URL` to override the default localhost / same-origin
10
- * resolution.
11
- *
12
- * Throws an `Error` when the HTTP response is non-2xx, when the GraphQL
13
- * payload carries an `errors` array, or when the response has no `data`
14
- * field.
15
- *
16
- * @typeParam TData - Shape of the `data` field for the operation.
17
- * @param query - GraphQL operation document (query or mutation source).
18
- * @param variables - Variables passed to the GraphQL operation.
19
- *
20
- * @example
21
- * ```ts
22
- * interface PingData { readonly memberCount: number; }
23
- * const data = await requestGraphQl<PingData>('query Ping { memberCount }');
24
- * console.log(data.memberCount);
25
- * ```
26
- */
27
- export declare function requestGraphQl<TData>(query: string, variables?: Readonly<Record<string, unknown>>): Promise<TData>;
28
- /**
29
- * Resolves the GraphQL endpoint URL used by {@link requestGraphQl}.
30
- *
31
- * Resolution order:
32
- * 1. `process.env.NEXT_PUBLIC_API_URL` if non-empty.
33
- * 2. `http://localhost:17603/graphql` when the browser is on
34
- * `localhost` / `127.0.0.1`.
35
- * 3. Same-origin `/graphql` for any other hostname (and for non-browser
36
- * runtimes such as Node SSR).
37
- */
38
- export declare function readGraphQlEndpoint(): string;
39
- /**
40
- * Pure helper used by {@link readGraphQlEndpoint}.
41
- *
42
- * Exposed mainly for tests and for hosts that want to derive their own
43
- * endpoint URLs without coupling to environment variables.
44
- */
45
- export declare function resolveDefaultGraphQlEndpoint(hostname: string | null): string;
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requestGraphQl = requestGraphQl;
4
- exports.readGraphQlEndpoint = readGraphQlEndpoint;
5
- exports.resolveDefaultGraphQlEndpoint = resolveDefaultGraphQlEndpoint;
6
- const client_config_1 = require("./client-config");
7
- const LOCAL_GRAPHQL_ENDPOINT = 'http://localhost:17603/graphql';
8
- const SAME_ORIGIN_GRAPHQL_ENDPOINT = '/graphql';
9
- /**
10
- * Sends a single GraphQL operation to the BPM host and returns the typed data.
11
- *
12
- * Uses the standard Fetch API with `credentials: 'include'`, so any
13
- * HTTP-only session cookie issued by the host's `POST /auth/login` endpoint
14
- * flows back automatically on subsequent calls.
15
- *
16
- * The endpoint URL is resolved by {@link readGraphQlEndpoint} — set
17
- * `NEXT_PUBLIC_API_URL` to override the default localhost / same-origin
18
- * resolution.
19
- *
20
- * Throws an `Error` when the HTTP response is non-2xx, when the GraphQL
21
- * payload carries an `errors` array, or when the response has no `data`
22
- * field.
23
- *
24
- * @typeParam TData - Shape of the `data` field for the operation.
25
- * @param query - GraphQL operation document (query or mutation source).
26
- * @param variables - Variables passed to the GraphQL operation.
27
- *
28
- * @example
29
- * ```ts
30
- * interface PingData { readonly memberCount: number; }
31
- * const data = await requestGraphQl<PingData>('query Ping { memberCount }');
32
- * console.log(data.memberCount);
33
- * ```
34
- */
35
- async function requestGraphQl(query, variables) {
36
- const fetchImpl = (0, client_config_1.resolveBPMFetch)();
37
- const response = await fetchImpl(readGraphQlEndpoint(), {
38
- body: JSON.stringify({ query, variables }),
39
- credentials: 'include',
40
- headers: buildGraphQlHeaders(),
41
- method: 'POST',
42
- });
43
- if (!response.ok) {
44
- throw new Error(`GraphQL request failed with HTTP ${response.status}`);
45
- }
46
- const payload = (await response.json());
47
- if (payload.errors?.length) {
48
- throw new Error(payload.errors.map((error) => error.message).join('; '));
49
- }
50
- if (!payload.data) {
51
- throw new Error('GraphQL response did not include data');
52
- }
53
- return payload.data;
54
- }
55
- /**
56
- * Resolves the GraphQL endpoint URL used by {@link requestGraphQl}.
57
- *
58
- * Resolution order:
59
- * 1. `process.env.NEXT_PUBLIC_API_URL` if non-empty.
60
- * 2. `http://localhost:17603/graphql` when the browser is on
61
- * `localhost` / `127.0.0.1`.
62
- * 3. Same-origin `/graphql` for any other hostname (and for non-browser
63
- * runtimes such as Node SSR).
64
- */
65
- function readGraphQlEndpoint() {
66
- const configured = (0, client_config_1.readBPMClientConfig)().baseUrl?.trim();
67
- if (configured) {
68
- return configured.endsWith('/graphql')
69
- ? configured
70
- : `${configured.replace(/\/$/, '')}/graphql`;
71
- }
72
- return (readOptionalPublicEnvValue(process.env.NEXT_PUBLIC_API_URL) ??
73
- resolveDefaultGraphQlEndpoint(readBrowserHostname()));
74
- }
75
- /**
76
- * Pure helper used by {@link readGraphQlEndpoint}.
77
- *
78
- * Exposed mainly for tests and for hosts that want to derive their own
79
- * endpoint URLs without coupling to environment variables.
80
- */
81
- function resolveDefaultGraphQlEndpoint(hostname) {
82
- return isLocalHost(hostname)
83
- ? LOCAL_GRAPHQL_ENDPOINT
84
- : SAME_ORIGIN_GRAPHQL_ENDPOINT;
85
- }
86
- function buildGraphQlHeaders() {
87
- return {
88
- ...(0, client_config_1.readBPMConfiguredHeaders)(),
89
- 'Content-Type': 'application/json',
90
- };
91
- }
92
- function readOptionalPublicEnvValue(value) {
93
- return value?.trim() || null;
94
- }
95
- function readBrowserHostname() {
96
- return typeof window === 'undefined' ? null : window.location.hostname;
97
- }
98
- function isLocalHost(hostname) {
99
- return hostname === 'localhost' || hostname === '127.0.0.1';
100
- }
101
- //# sourceMappingURL=graphql-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphql-client.js","sourceRoot":"","sources":["../../../../../libs/bpm-core-client/src/lib/graphql-client.ts"],"names":[],"mappings":";;AA4CA,wCA2BC;AAYD,kDAWC;AAQD,sEAMC;AA5GD,mDAIyB;AAEzB,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AAChE,MAAM,4BAA4B,GAAG,UAAU,CAAC;AAWhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,KAAK,UAAU,cAAc,CAClC,KAAa,EACb,SAA6C;IAE7C,MAAM,SAAS,GAAG,IAAA,+BAAe,GAAE,CAAC;IACpC,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,mBAAmB,EAAE,EAAE;QACtD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAC1C,WAAW,EAAE,SAAS;QACtB,OAAO,EAAE,mBAAmB,EAAE;QAC9B,MAAM,EAAE,MAAM;KACf,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,oCAAoC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA2B,CAAC;IAElE,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,OAAO,CAAC,IAAI,CAAC;AACtB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,mBAAmB;IACjC,MAAM,UAAU,GAAG,IAAA,mCAAmB,GAAE,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;IACzD,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC;YACpC,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC;IACjD,CAAC;IACD,OAAO,CACL,0BAA0B,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAC3D,6BAA6B,CAAC,mBAAmB,EAAE,CAAC,CACrD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,QAAuB;IAEvB,OAAO,WAAW,CAAC,QAAQ,CAAC;QAC1B,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,4BAA4B,CAAC;AACnC,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO;QACL,GAAG,IAAA,wCAAwB,GAAE;QAC7B,cAAc,EAAE,kBAAkB;KACnC,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAyB;IAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC;AAC/B,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACzE,CAAC;AAED,SAAS,WAAW,CAAC,QAAuB;IAC1C,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,WAAW,CAAC;AAC9D,CAAC"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Member profile record exposed by the BPM identity GraphQL surface.
3
- *
4
- * `customFieldsJson` is a stringified JSON blob — BPM does not impose a
5
- * schema on host-side member metadata. Consumers parse it according to
6
- * their own host conventions.
7
- */
8
- export interface MemberProfileRecord {
9
- readonly customFieldsJson: string;
10
- readonly email: string;
11
- readonly memberId: string;
12
- readonly name: string;
13
- }
14
- /**
15
- * A paginated slice of the host member directory, returned by
16
- * {@link listMemberDirectoryPage}.
17
- */
18
- export interface MemberDirectoryPage {
19
- readonly members: readonly MemberProfileRecord[];
20
- readonly totalCount: number;
21
- }
22
- /**
23
- * Resolves a set of `memberId`s into full member profile records by hitting
24
- * BPM's `members(memberIds: [String!]!)` GraphQL query, which in turn calls
25
- * the host-provided `BPMMemberResolver.resolveMany`.
26
- *
27
- * Returns an empty array when given an empty input — does not make a
28
- * network call in that case.
29
- */
30
- export declare function resolveMembers(memberIds: readonly string[]): Promise<readonly MemberProfileRecord[]>;
31
- /**
32
- * Free-text search over the host's member directory through BPM's
33
- * `searchMembers(searchText: String!)` query. The matching strategy is
34
- * defined by the host's `BPMMemberResolver.search` implementation.
35
- */
36
- export declare function searchMembers(searchText: string): Promise<readonly MemberProfileRecord[]>;
37
- /**
38
- * Reads a single page of the member directory (search + total count in a
39
- * single GraphQL roundtrip).
40
- *
41
- * @param page - 1-based page index.
42
- * @param pageSize - Items per page.
43
- * @param searchText - Optional free-text filter; empty string returns all.
44
- */
45
- export declare function listMemberDirectoryPage({ page, pageSize, searchText, }: {
46
- readonly page: number;
47
- readonly pageSize: number;
48
- readonly searchText?: string;
49
- }): Promise<MemberDirectoryPage>;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveMembers = resolveMembers;
4
- exports.searchMembers = searchMembers;
5
- exports.listMemberDirectoryPage = listMemberDirectoryPage;
6
- const graphql_client_1 = require("./graphql-client");
7
- /**
8
- * Resolves a set of `memberId`s into full member profile records by hitting
9
- * BPM's `members(memberIds: [String!]!)` GraphQL query, which in turn calls
10
- * the host-provided `BPMMemberResolver.resolveMany`.
11
- *
12
- * Returns an empty array when given an empty input — does not make a
13
- * network call in that case.
14
- */
15
- async function resolveMembers(memberIds) {
16
- if (!memberIds.length) {
17
- return [];
18
- }
19
- const data = await (0, graphql_client_1.requestGraphQl)(`query AdminMembers($memberIds: [String!]!) {
20
- members(memberIds: $memberIds) {
21
- customFieldsJson
22
- email
23
- memberId
24
- name
25
- }
26
- }`, { memberIds });
27
- return data.members;
28
- }
29
- /**
30
- * Free-text search over the host's member directory through BPM's
31
- * `searchMembers(searchText: String!)` query. The matching strategy is
32
- * defined by the host's `BPMMemberResolver.search` implementation.
33
- */
34
- async function searchMembers(searchText) {
35
- const data = await (0, graphql_client_1.requestGraphQl)(`query AdminSearchMembers($searchText: String!) {
36
- searchMembers(searchText: $searchText) {
37
- customFieldsJson
38
- email
39
- memberId
40
- name
41
- }
42
- }`, { searchText });
43
- return data.searchMembers;
44
- }
45
- /**
46
- * Reads a single page of the member directory (search + total count in a
47
- * single GraphQL roundtrip).
48
- *
49
- * @param page - 1-based page index.
50
- * @param pageSize - Items per page.
51
- * @param searchText - Optional free-text filter; empty string returns all.
52
- */
53
- async function listMemberDirectoryPage({ page, pageSize, searchText = '', }) {
54
- const data = await (0, graphql_client_1.requestGraphQl)(`query AdminMemberDirectoryPage(
55
- $page: Int
56
- $pageSize: Int
57
- $searchText: String!
58
- ) {
59
- searchMembers(page: $page, pageSize: $pageSize, searchText: $searchText) {
60
- customFieldsJson
61
- email
62
- memberId
63
- name
64
- }
65
- memberCount(searchText: $searchText)
66
- }`, { page, pageSize, searchText });
67
- return {
68
- members: data.searchMembers,
69
- totalCount: data.memberCount,
70
- };
71
- }
72
- //# sourceMappingURL=member-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"member-api.js","sourceRoot":"","sources":["../../../../../libs/bpm-core-client/src/lib/member-api.ts"],"names":[],"mappings":";;AA6CA,wCAoBC;AAOD,sCAgBC;AAUD,0DA8BC;AAhID,qDAAkD;AAqClD;;;;;;;GAOG;AACI,KAAK,UAAU,cAAc,CAClC,SAA4B;IAE5B,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAc,EAC/B;;;;;;;MAOE,EACF,EAAE,SAAS,EAAE,CACd,CAAC;IAEF,OAAO,IAAI,CAAC,OAAO,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,aAAa,CACjC,UAAkB;IAElB,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAc,EAC/B;;;;;;;MAOE,EACF,EAAE,UAAU,EAAE,CACf,CAAC;IAEF,OAAO,IAAI,CAAC,aAAa,CAAC;AAC5B,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,uBAAuB,CAAC,EAC5C,IAAI,EACJ,QAAQ,EACR,UAAU,GAAG,EAAE,GAKhB;IACC,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAc,EAC/B;;;;;;;;;;;;MAYE,EACF,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAC/B,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,aAAa;QAC3B,UAAU,EAAE,IAAI,CAAC,WAAW;KAC7B,CAAC;AACJ,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./organization-api"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/organization/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC"}
@@ -1,173 +0,0 @@
1
- import type { OrgUnitType, ManagerResolutionScopeType } from '@rytass/bpm-core-shared';
2
- /**
3
- * Re-exported from `@rytass/bpm-core-shared` for consumer convenience —
4
- * the single source of truth lives there. Both import paths produce
5
- * the same TypeScript type, so consumers may pick whichever subpath
6
- * they already import from elsewhere.
7
- */
8
- export type { OrgUnitType, ManagerResolutionScopeType };
9
- export interface OrgUnitRecord {
10
- readonly code: string;
11
- readonly createdAt: string;
12
- readonly deletedAt: string | null;
13
- readonly id: string;
14
- readonly name: string;
15
- readonly parentId: string | null;
16
- readonly path: string;
17
- readonly type: OrgUnitType;
18
- readonly updatedAt: string;
19
- }
20
- export interface PositionRecord {
21
- readonly code: string;
22
- readonly createdAt: string;
23
- readonly id: string;
24
- readonly level: number;
25
- readonly name: string;
26
- readonly updatedAt: string;
27
- }
28
- export interface MembershipRecord {
29
- readonly createdAt: string;
30
- readonly effectiveFrom: string;
31
- readonly effectiveTo: string | null;
32
- readonly id: string;
33
- readonly isPrimary: boolean;
34
- readonly memberId: string;
35
- readonly orgUnitId: string;
36
- readonly positionId: string | null;
37
- readonly updatedAt: string;
38
- }
39
- export interface ManagerResolutionRecord {
40
- readonly createdAt: string;
41
- readonly effectiveFrom: string;
42
- readonly effectiveTo: string | null;
43
- readonly id: string;
44
- readonly managerMemberId: string;
45
- readonly priority: number;
46
- readonly scopeId: string;
47
- readonly scopeType: ManagerResolutionScopeType;
48
- }
49
- export interface OrganizationSummaryRecord {
50
- readonly managerResolutionCount: number;
51
- readonly membershipCount: number;
52
- readonly orgUnitCount: number;
53
- readonly positionCount: number;
54
- }
55
- export interface ResolvedManagerRecord {
56
- readonly managerMemberId: string | null;
57
- readonly memberId: string;
58
- }
59
- interface OrganizationDashboardQueryData {
60
- readonly filteredManagerResolutions: readonly ManagerResolutionRecord[];
61
- readonly filteredMemberships: readonly MembershipRecord[];
62
- readonly filteredOrgUnits: readonly OrgUnitRecord[];
63
- readonly filteredPositions: readonly PositionRecord[];
64
- readonly managerResolutionCount: number;
65
- readonly managerResolutions: readonly ManagerResolutionRecord[];
66
- readonly membershipCount: number;
67
- readonly memberships: readonly MembershipRecord[];
68
- readonly organizationSummary: OrganizationSummaryRecord;
69
- readonly orgUnitCount: number;
70
- readonly orgUnits: readonly OrgUnitRecord[];
71
- readonly positionCount: number;
72
- readonly positions: readonly PositionRecord[];
73
- }
74
- export declare function readOrganizationDashboard({ managerActiveOnly, managerPage, managerPageSize, managerScopeType, membershipActiveOnly, membershipOrgUnitId, membershipPage, membershipPageSize, membershipPositionId, orgUnitPage, orgUnitPageSize, orgUnitSearchText, orgUnitType, positionPage, positionPageSize, positionSearchText, }?: {
75
- readonly managerActiveOnly?: boolean;
76
- readonly managerPage?: number;
77
- readonly managerPageSize?: number | null;
78
- readonly managerScopeType?: ManagerResolutionScopeType | null;
79
- readonly membershipActiveOnly?: boolean;
80
- readonly membershipOrgUnitId?: string | null;
81
- readonly membershipPage?: number;
82
- readonly membershipPageSize?: number | null;
83
- readonly membershipPositionId?: string | null;
84
- readonly orgUnitPage?: number;
85
- readonly orgUnitPageSize?: number | null;
86
- readonly orgUnitSearchText?: string | null;
87
- readonly orgUnitType?: OrgUnitType | null;
88
- readonly positionPage?: number;
89
- readonly positionPageSize?: number | null;
90
- readonly positionSearchText?: string | null;
91
- }): Promise<OrganizationDashboardQueryData>;
92
- export declare function listMemberships({ activeOnly, memberId, orgUnitId, }?: {
93
- readonly activeOnly?: boolean;
94
- readonly memberId?: string | null;
95
- readonly orgUnitId?: string | null;
96
- }): Promise<readonly MembershipRecord[]>;
97
- export declare function listManagerResolutions({ activeOnly, scopeId, scopeType, }?: {
98
- readonly activeOnly?: boolean;
99
- readonly scopeId?: string | null;
100
- readonly scopeType?: ManagerResolutionScopeType | null;
101
- }): Promise<readonly ManagerResolutionRecord[]>;
102
- export declare function readResolvedManager(memberId: string): Promise<ResolvedManagerRecord>;
103
- export declare function createOrgUnit(input: {
104
- readonly code: string;
105
- readonly metadataJson: string;
106
- readonly name: string;
107
- readonly parentId: string | null;
108
- readonly type: OrgUnitType;
109
- }): Promise<OrgUnitRecord>;
110
- export declare function updateOrgUnit(input: {
111
- readonly code: string | null;
112
- readonly id: string;
113
- readonly metadataJson: string | null;
114
- readonly name: string | null;
115
- readonly parentId: string | null;
116
- readonly type: OrgUnitType | null;
117
- }): Promise<OrgUnitRecord>;
118
- export declare function deleteOrgUnit(id: string): Promise<boolean>;
119
- export declare function commitOrgUnitTreeDraft(input: {
120
- readonly moves: readonly {
121
- readonly baseUpdatedAt: string;
122
- readonly id: string;
123
- readonly parentId: string | null;
124
- }[];
125
- }): Promise<readonly OrgUnitRecord[]>;
126
- export declare function createPosition(input: {
127
- readonly code: string;
128
- readonly level: number;
129
- readonly metadataJson: string;
130
- readonly name: string;
131
- }): Promise<PositionRecord>;
132
- export declare function updatePosition(input: {
133
- readonly code: string | null;
134
- readonly id: string;
135
- readonly level: number | null;
136
- readonly metadataJson: string | null;
137
- readonly name: string | null;
138
- }): Promise<PositionRecord>;
139
- export declare function createMembership(input: {
140
- readonly effectiveFrom: string;
141
- readonly effectiveTo: string | null;
142
- readonly isPrimary: boolean;
143
- readonly memberId: string;
144
- readonly orgUnitId: string;
145
- readonly positionId: string | null;
146
- }): Promise<MembershipRecord>;
147
- export declare function updateMembership(input: {
148
- readonly effectiveFrom: string | null;
149
- readonly effectiveTo: string | null;
150
- readonly id: string;
151
- readonly isPrimary: boolean | null;
152
- readonly orgUnitId: string | null;
153
- readonly positionId: string | null;
154
- }): Promise<MembershipRecord>;
155
- export declare function deleteMembership(id: string): Promise<boolean>;
156
- export declare function createManagerResolution(input: {
157
- readonly effectiveFrom: string;
158
- readonly effectiveTo: string | null;
159
- readonly managerMemberId: string;
160
- readonly priority: number;
161
- readonly scopeId: string;
162
- readonly scopeType: ManagerResolutionScopeType;
163
- }): Promise<ManagerResolutionRecord>;
164
- export declare function updateManagerResolution(input: {
165
- readonly effectiveFrom: string | null;
166
- readonly effectiveTo: string | null;
167
- readonly id: string;
168
- readonly managerMemberId: string | null;
169
- readonly priority: number | null;
170
- readonly scopeId: string | null;
171
- readonly scopeType: ManagerResolutionScopeType | null;
172
- }): Promise<ManagerResolutionRecord>;
173
- export declare function deleteManagerResolution(id: string): Promise<boolean>;