@rytass/bpm-core-client 0.5.0 → 0.5.1
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/CHANGELOG.md +11 -0
- package/package.json +3 -2
- package/src/index.js +8 -0
- package/src/index.js.map +1 -0
- package/src/lib/api-auth-client.d.ts +73 -0
- package/src/lib/api-auth-client.js +129 -0
- package/src/lib/api-auth-client.js.map +1 -0
- package/src/lib/client-config.d.ts +81 -0
- package/src/lib/client-config.js +63 -0
- package/src/lib/client-config.js.map +1 -0
- package/src/lib/form/form-api.d.ts +54 -0
- package/src/lib/form/form-api.js +240 -0
- package/src/lib/form/form-api.js.map +1 -0
- package/src/lib/form/form-rendering.d.ts +52 -0
- package/src/lib/form/form-rendering.js +341 -0
- package/src/lib/form/form-rendering.js.map +1 -0
- package/src/lib/form/index.js +6 -0
- package/src/lib/form/index.js.map +1 -0
- package/src/lib/graphql-client.d.ts +45 -0
- package/src/lib/graphql-client.js +101 -0
- package/src/lib/graphql-client.js.map +1 -0
- package/src/lib/member-api.d.ts +49 -0
- package/src/lib/member-api.js +72 -0
- package/src/lib/member-api.js.map +1 -0
- package/src/lib/organization/index.js +5 -0
- package/src/lib/organization/index.js.map +1 -0
- package/src/lib/organization/organization-api.d.ts +173 -0
- package/src/lib/organization/organization-api.js +394 -0
- package/src/lib/organization/organization-api.js.map +1 -0
- package/src/lib/template/index.js +5 -0
- package/src/lib/template/index.js.map +1 -0
- package/src/lib/template/template-api.d.ts +174 -0
- package/src/lib/template/template-api.js +469 -0
- package/src/lib/template/template-api.js.map +1 -0
- package/src/lib/workflow/index.js +5 -0
- package/src/lib/workflow/index.js.map +1 -0
- package/src/lib/workflow/workflow-api.d.ts +517 -0
- package/src/lib/workflow/workflow-api.js +1068 -0
- package/src/lib/workflow/workflow-api.js.map +1 -0
- package/eslint.config.mjs +0 -19
- package/jest.config.cts +0 -10
- package/project.json +0 -66
- package/src/lib/api-auth-client.ts +0 -182
- package/src/lib/client-config.ts +0 -99
- package/src/lib/form/form-api.spec.ts +0 -81
- package/src/lib/form/form-api.ts +0 -402
- package/src/lib/form/form-rendering.ts +0 -580
- package/src/lib/graphql-client.spec.ts +0 -65
- package/src/lib/graphql-client.ts +0 -128
- package/src/lib/member-api.ts +0 -129
- package/src/lib/organization/organization-api.spec.ts +0 -90
- package/src/lib/organization/organization-api.ts +0 -711
- package/src/lib/template/template-api.spec.ts +0 -88
- package/src/lib/template/template-api.ts +0 -894
- package/src/lib/workflow/workflow-api.spec.ts +0 -132
- package/src/lib/workflow/workflow-api.ts +0 -2124
- package/tsconfig.json +0 -27
- package/tsconfig.lib.json +0 -16
- package/tsconfig.spec.json +0 -16
- /package/src/{index.ts → index.d.ts} +0 -0
- /package/src/lib/form/{index.ts → index.d.ts} +0 -0
- /package/src/lib/organization/{index.ts → index.d.ts} +0 -0
- /package/src/lib/template/{index.ts → index.d.ts} +0 -0
- /package/src/lib/workflow/{index.ts → index.d.ts} +0 -0
|
@@ -1,711 +0,0 @@
|
|
|
1
|
-
import { requestGraphQl } from '../graphql-client';
|
|
2
|
-
import type {
|
|
3
|
-
OrgUnitType,
|
|
4
|
-
ManagerResolutionScopeType,
|
|
5
|
-
} from '@rytass/bpm-core-shared';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Re-exported from `@rytass/bpm-core-shared` for consumer convenience —
|
|
9
|
-
* the single source of truth lives there. Both import paths produce
|
|
10
|
-
* the same TypeScript type, so consumers may pick whichever subpath
|
|
11
|
-
* they already import from elsewhere.
|
|
12
|
-
*/
|
|
13
|
-
export type { OrgUnitType, ManagerResolutionScopeType };
|
|
14
|
-
|
|
15
|
-
export interface OrgUnitRecord {
|
|
16
|
-
readonly code: string;
|
|
17
|
-
readonly createdAt: string;
|
|
18
|
-
readonly deletedAt: string | null;
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly name: string;
|
|
21
|
-
readonly parentId: string | null;
|
|
22
|
-
readonly path: string;
|
|
23
|
-
readonly type: OrgUnitType;
|
|
24
|
-
readonly updatedAt: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface PositionRecord {
|
|
28
|
-
readonly code: string;
|
|
29
|
-
readonly createdAt: string;
|
|
30
|
-
readonly id: string;
|
|
31
|
-
readonly level: number;
|
|
32
|
-
readonly name: string;
|
|
33
|
-
readonly updatedAt: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface MembershipRecord {
|
|
37
|
-
readonly createdAt: string;
|
|
38
|
-
readonly effectiveFrom: string;
|
|
39
|
-
readonly effectiveTo: string | null;
|
|
40
|
-
readonly id: string;
|
|
41
|
-
readonly isPrimary: boolean;
|
|
42
|
-
readonly memberId: string;
|
|
43
|
-
readonly orgUnitId: string;
|
|
44
|
-
readonly positionId: string | null;
|
|
45
|
-
readonly updatedAt: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface ManagerResolutionRecord {
|
|
49
|
-
readonly createdAt: string;
|
|
50
|
-
readonly effectiveFrom: string;
|
|
51
|
-
readonly effectiveTo: string | null;
|
|
52
|
-
readonly id: string;
|
|
53
|
-
readonly managerMemberId: string;
|
|
54
|
-
readonly priority: number;
|
|
55
|
-
readonly scopeId: string;
|
|
56
|
-
readonly scopeType: ManagerResolutionScopeType;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface OrganizationSummaryRecord {
|
|
60
|
-
readonly managerResolutionCount: number;
|
|
61
|
-
readonly membershipCount: number;
|
|
62
|
-
readonly orgUnitCount: number;
|
|
63
|
-
readonly positionCount: number;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ResolvedManagerRecord {
|
|
67
|
-
readonly managerMemberId: string | null;
|
|
68
|
-
readonly memberId: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
interface OrganizationDashboardQueryData {
|
|
72
|
-
readonly filteredManagerResolutions: readonly ManagerResolutionRecord[];
|
|
73
|
-
readonly filteredMemberships: readonly MembershipRecord[];
|
|
74
|
-
readonly filteredOrgUnits: readonly OrgUnitRecord[];
|
|
75
|
-
readonly filteredPositions: readonly PositionRecord[];
|
|
76
|
-
readonly managerResolutionCount: number;
|
|
77
|
-
readonly managerResolutions: readonly ManagerResolutionRecord[];
|
|
78
|
-
readonly membershipCount: number;
|
|
79
|
-
readonly memberships: readonly MembershipRecord[];
|
|
80
|
-
readonly organizationSummary: OrganizationSummaryRecord;
|
|
81
|
-
readonly orgUnitCount: number;
|
|
82
|
-
readonly orgUnits: readonly OrgUnitRecord[];
|
|
83
|
-
readonly positionCount: number;
|
|
84
|
-
readonly positions: readonly PositionRecord[];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
interface MembershipsQueryData {
|
|
88
|
-
readonly memberships: readonly MembershipRecord[];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
interface ManagerResolutionsQueryData {
|
|
92
|
-
readonly managerResolutions: readonly ManagerResolutionRecord[];
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
interface ResolvedManagerQueryData {
|
|
96
|
-
readonly resolvedManager: ResolvedManagerRecord;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
interface CreateOrgUnitMutationData {
|
|
100
|
-
readonly createOrgUnit: OrgUnitRecord;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
interface UpdateOrgUnitMutationData {
|
|
104
|
-
readonly updateOrgUnit: OrgUnitRecord;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
interface DeleteOrgUnitMutationData {
|
|
108
|
-
readonly deleteOrgUnit: boolean;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
interface CommitOrgUnitTreeDraftMutationData {
|
|
112
|
-
readonly commitOrgUnitTreeDraft: {
|
|
113
|
-
readonly orgUnits: readonly OrgUnitRecord[];
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
interface CreatePositionMutationData {
|
|
118
|
-
readonly createPosition: PositionRecord;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
interface UpdatePositionMutationData {
|
|
122
|
-
readonly updatePosition: PositionRecord;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
interface CreateMembershipMutationData {
|
|
126
|
-
readonly createMembership: MembershipRecord;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
interface UpdateMembershipMutationData {
|
|
130
|
-
readonly updateMembership: MembershipRecord;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
interface DeleteMembershipMutationData {
|
|
134
|
-
readonly deleteMembership: boolean;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
interface CreateManagerResolutionMutationData {
|
|
138
|
-
readonly createManagerResolution: ManagerResolutionRecord;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
interface UpdateManagerResolutionMutationData {
|
|
142
|
-
readonly updateManagerResolution: ManagerResolutionRecord;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
interface DeleteManagerResolutionMutationData {
|
|
146
|
-
readonly deleteManagerResolution: boolean;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export async function readOrganizationDashboard({
|
|
150
|
-
managerActiveOnly = false,
|
|
151
|
-
managerPage = 1,
|
|
152
|
-
managerPageSize = null,
|
|
153
|
-
managerScopeType = null,
|
|
154
|
-
membershipActiveOnly = false,
|
|
155
|
-
membershipOrgUnitId = null,
|
|
156
|
-
membershipPage = 1,
|
|
157
|
-
membershipPageSize = null,
|
|
158
|
-
membershipPositionId = null,
|
|
159
|
-
orgUnitPage = 1,
|
|
160
|
-
orgUnitPageSize = null,
|
|
161
|
-
orgUnitSearchText = null,
|
|
162
|
-
orgUnitType = null,
|
|
163
|
-
positionPage = 1,
|
|
164
|
-
positionPageSize = null,
|
|
165
|
-
positionSearchText = null,
|
|
166
|
-
}: {
|
|
167
|
-
readonly managerActiveOnly?: boolean;
|
|
168
|
-
readonly managerPage?: number;
|
|
169
|
-
readonly managerPageSize?: number | null;
|
|
170
|
-
readonly managerScopeType?: ManagerResolutionScopeType | null;
|
|
171
|
-
readonly membershipActiveOnly?: boolean;
|
|
172
|
-
readonly membershipOrgUnitId?: string | null;
|
|
173
|
-
readonly membershipPage?: number;
|
|
174
|
-
readonly membershipPageSize?: number | null;
|
|
175
|
-
readonly membershipPositionId?: string | null;
|
|
176
|
-
readonly orgUnitPage?: number;
|
|
177
|
-
readonly orgUnitPageSize?: number | null;
|
|
178
|
-
readonly orgUnitSearchText?: string | null;
|
|
179
|
-
readonly orgUnitType?: OrgUnitType | null;
|
|
180
|
-
readonly positionPage?: number;
|
|
181
|
-
readonly positionPageSize?: number | null;
|
|
182
|
-
readonly positionSearchText?: string | null;
|
|
183
|
-
} = {}): Promise<OrganizationDashboardQueryData> {
|
|
184
|
-
return requestGraphQl<OrganizationDashboardQueryData>(
|
|
185
|
-
`query AdminOrganizationDashboard(
|
|
186
|
-
$managerActiveOnly: Boolean
|
|
187
|
-
$managerPage: Int
|
|
188
|
-
$managerPageSize: Int
|
|
189
|
-
$managerScopeType: ManagerResolutionScopeType
|
|
190
|
-
$membershipActiveOnly: Boolean
|
|
191
|
-
$membershipOrgUnitId: String
|
|
192
|
-
$membershipPage: Int
|
|
193
|
-
$membershipPageSize: Int
|
|
194
|
-
$membershipPositionId: String
|
|
195
|
-
$orgUnitPage: Int
|
|
196
|
-
$orgUnitPageSize: Int
|
|
197
|
-
$orgUnitSearchText: String
|
|
198
|
-
$orgUnitType: OrgUnitType
|
|
199
|
-
$positionPage: Int
|
|
200
|
-
$positionPageSize: Int
|
|
201
|
-
$positionSearchText: String
|
|
202
|
-
) {
|
|
203
|
-
organizationSummary {
|
|
204
|
-
managerResolutionCount
|
|
205
|
-
membershipCount
|
|
206
|
-
orgUnitCount
|
|
207
|
-
positionCount
|
|
208
|
-
}
|
|
209
|
-
filteredOrgUnits: orgUnits(
|
|
210
|
-
page: $orgUnitPage
|
|
211
|
-
pageSize: $orgUnitPageSize
|
|
212
|
-
searchText: $orgUnitSearchText
|
|
213
|
-
type: $orgUnitType
|
|
214
|
-
) {
|
|
215
|
-
code
|
|
216
|
-
createdAt
|
|
217
|
-
deletedAt
|
|
218
|
-
id
|
|
219
|
-
name
|
|
220
|
-
parentId
|
|
221
|
-
path
|
|
222
|
-
type
|
|
223
|
-
updatedAt
|
|
224
|
-
}
|
|
225
|
-
orgUnitCount(
|
|
226
|
-
searchText: $orgUnitSearchText
|
|
227
|
-
type: $orgUnitType
|
|
228
|
-
)
|
|
229
|
-
orgUnits(all: true) {
|
|
230
|
-
code
|
|
231
|
-
createdAt
|
|
232
|
-
deletedAt
|
|
233
|
-
id
|
|
234
|
-
name
|
|
235
|
-
parentId
|
|
236
|
-
path
|
|
237
|
-
type
|
|
238
|
-
updatedAt
|
|
239
|
-
}
|
|
240
|
-
filteredPositions: positions(
|
|
241
|
-
page: $positionPage
|
|
242
|
-
pageSize: $positionPageSize
|
|
243
|
-
searchText: $positionSearchText
|
|
244
|
-
) {
|
|
245
|
-
code
|
|
246
|
-
createdAt
|
|
247
|
-
id
|
|
248
|
-
level
|
|
249
|
-
name
|
|
250
|
-
updatedAt
|
|
251
|
-
}
|
|
252
|
-
positionCount(searchText: $positionSearchText)
|
|
253
|
-
positions {
|
|
254
|
-
code
|
|
255
|
-
createdAt
|
|
256
|
-
id
|
|
257
|
-
level
|
|
258
|
-
name
|
|
259
|
-
updatedAt
|
|
260
|
-
}
|
|
261
|
-
filteredMemberships: memberships(
|
|
262
|
-
activeOnly: $membershipActiveOnly
|
|
263
|
-
orgUnitId: $membershipOrgUnitId
|
|
264
|
-
page: $membershipPage
|
|
265
|
-
pageSize: $membershipPageSize
|
|
266
|
-
positionId: $membershipPositionId
|
|
267
|
-
) {
|
|
268
|
-
createdAt
|
|
269
|
-
effectiveFrom
|
|
270
|
-
effectiveTo
|
|
271
|
-
id
|
|
272
|
-
isPrimary
|
|
273
|
-
memberId
|
|
274
|
-
orgUnitId
|
|
275
|
-
positionId
|
|
276
|
-
updatedAt
|
|
277
|
-
}
|
|
278
|
-
membershipCount(
|
|
279
|
-
activeOnly: $membershipActiveOnly
|
|
280
|
-
orgUnitId: $membershipOrgUnitId
|
|
281
|
-
positionId: $membershipPositionId
|
|
282
|
-
)
|
|
283
|
-
memberships {
|
|
284
|
-
createdAt
|
|
285
|
-
effectiveFrom
|
|
286
|
-
effectiveTo
|
|
287
|
-
id
|
|
288
|
-
isPrimary
|
|
289
|
-
memberId
|
|
290
|
-
orgUnitId
|
|
291
|
-
positionId
|
|
292
|
-
updatedAt
|
|
293
|
-
}
|
|
294
|
-
filteredManagerResolutions: managerResolutions(
|
|
295
|
-
activeOnly: $managerActiveOnly
|
|
296
|
-
page: $managerPage
|
|
297
|
-
pageSize: $managerPageSize
|
|
298
|
-
scopeType: $managerScopeType
|
|
299
|
-
) {
|
|
300
|
-
createdAt
|
|
301
|
-
effectiveFrom
|
|
302
|
-
effectiveTo
|
|
303
|
-
id
|
|
304
|
-
managerMemberId
|
|
305
|
-
priority
|
|
306
|
-
scopeId
|
|
307
|
-
scopeType
|
|
308
|
-
}
|
|
309
|
-
managerResolutionCount(
|
|
310
|
-
activeOnly: $managerActiveOnly
|
|
311
|
-
scopeType: $managerScopeType
|
|
312
|
-
)
|
|
313
|
-
managerResolutions {
|
|
314
|
-
createdAt
|
|
315
|
-
effectiveFrom
|
|
316
|
-
effectiveTo
|
|
317
|
-
id
|
|
318
|
-
managerMemberId
|
|
319
|
-
priority
|
|
320
|
-
scopeId
|
|
321
|
-
scopeType
|
|
322
|
-
}
|
|
323
|
-
}`,
|
|
324
|
-
{
|
|
325
|
-
managerActiveOnly,
|
|
326
|
-
managerPage,
|
|
327
|
-
managerPageSize,
|
|
328
|
-
managerScopeType,
|
|
329
|
-
membershipActiveOnly,
|
|
330
|
-
membershipOrgUnitId,
|
|
331
|
-
membershipPage,
|
|
332
|
-
membershipPageSize,
|
|
333
|
-
membershipPositionId,
|
|
334
|
-
orgUnitPage,
|
|
335
|
-
orgUnitPageSize,
|
|
336
|
-
orgUnitSearchText,
|
|
337
|
-
orgUnitType,
|
|
338
|
-
positionPage,
|
|
339
|
-
positionPageSize,
|
|
340
|
-
positionSearchText,
|
|
341
|
-
},
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export async function listMemberships({
|
|
346
|
-
activeOnly = false,
|
|
347
|
-
memberId = null,
|
|
348
|
-
orgUnitId = null,
|
|
349
|
-
}: {
|
|
350
|
-
readonly activeOnly?: boolean;
|
|
351
|
-
readonly memberId?: string | null;
|
|
352
|
-
readonly orgUnitId?: string | null;
|
|
353
|
-
} = {}): Promise<readonly MembershipRecord[]> {
|
|
354
|
-
const data = await requestGraphQl<MembershipsQueryData>(
|
|
355
|
-
`query AdminMemberships(
|
|
356
|
-
$activeOnly: Boolean
|
|
357
|
-
$memberId: String
|
|
358
|
-
$orgUnitId: String
|
|
359
|
-
) {
|
|
360
|
-
memberships(
|
|
361
|
-
activeOnly: $activeOnly
|
|
362
|
-
memberId: $memberId
|
|
363
|
-
orgUnitId: $orgUnitId
|
|
364
|
-
) {
|
|
365
|
-
createdAt
|
|
366
|
-
effectiveFrom
|
|
367
|
-
effectiveTo
|
|
368
|
-
id
|
|
369
|
-
isPrimary
|
|
370
|
-
memberId
|
|
371
|
-
orgUnitId
|
|
372
|
-
positionId
|
|
373
|
-
updatedAt
|
|
374
|
-
}
|
|
375
|
-
}`,
|
|
376
|
-
{ activeOnly, memberId, orgUnitId },
|
|
377
|
-
);
|
|
378
|
-
|
|
379
|
-
return data.memberships;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
export async function listManagerResolutions({
|
|
383
|
-
activeOnly = false,
|
|
384
|
-
scopeId = null,
|
|
385
|
-
scopeType = null,
|
|
386
|
-
}: {
|
|
387
|
-
readonly activeOnly?: boolean;
|
|
388
|
-
readonly scopeId?: string | null;
|
|
389
|
-
readonly scopeType?: ManagerResolutionScopeType | null;
|
|
390
|
-
} = {}): Promise<readonly ManagerResolutionRecord[]> {
|
|
391
|
-
const data = await requestGraphQl<ManagerResolutionsQueryData>(
|
|
392
|
-
`query AdminManagerResolutions(
|
|
393
|
-
$activeOnly: Boolean
|
|
394
|
-
$scopeId: String
|
|
395
|
-
$scopeType: ManagerResolutionScopeType
|
|
396
|
-
) {
|
|
397
|
-
managerResolutions(
|
|
398
|
-
activeOnly: $activeOnly
|
|
399
|
-
scopeId: $scopeId
|
|
400
|
-
scopeType: $scopeType
|
|
401
|
-
) {
|
|
402
|
-
createdAt
|
|
403
|
-
effectiveFrom
|
|
404
|
-
effectiveTo
|
|
405
|
-
id
|
|
406
|
-
managerMemberId
|
|
407
|
-
priority
|
|
408
|
-
scopeId
|
|
409
|
-
scopeType
|
|
410
|
-
}
|
|
411
|
-
}`,
|
|
412
|
-
{ activeOnly, scopeId, scopeType },
|
|
413
|
-
);
|
|
414
|
-
|
|
415
|
-
return data.managerResolutions;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export async function readResolvedManager(
|
|
419
|
-
memberId: string,
|
|
420
|
-
): Promise<ResolvedManagerRecord> {
|
|
421
|
-
const data = await requestGraphQl<ResolvedManagerQueryData>(
|
|
422
|
-
`query AdminResolvedManager($memberId: String!) {
|
|
423
|
-
resolvedManager(memberId: $memberId) {
|
|
424
|
-
managerMemberId
|
|
425
|
-
memberId
|
|
426
|
-
}
|
|
427
|
-
}`,
|
|
428
|
-
{ memberId },
|
|
429
|
-
);
|
|
430
|
-
|
|
431
|
-
return data.resolvedManager;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
export async function createOrgUnit(input: {
|
|
435
|
-
readonly code: string;
|
|
436
|
-
readonly metadataJson: string;
|
|
437
|
-
readonly name: string;
|
|
438
|
-
readonly parentId: string | null;
|
|
439
|
-
readonly type: OrgUnitType;
|
|
440
|
-
}): Promise<OrgUnitRecord> {
|
|
441
|
-
const data = await requestGraphQl<CreateOrgUnitMutationData>(
|
|
442
|
-
`mutation AdminCreateOrgUnit($input: CreateOrgUnitInput!) {
|
|
443
|
-
createOrgUnit(input: $input) {
|
|
444
|
-
code
|
|
445
|
-
createdAt
|
|
446
|
-
deletedAt
|
|
447
|
-
id
|
|
448
|
-
name
|
|
449
|
-
parentId
|
|
450
|
-
path
|
|
451
|
-
type
|
|
452
|
-
updatedAt
|
|
453
|
-
}
|
|
454
|
-
}`,
|
|
455
|
-
{ input },
|
|
456
|
-
);
|
|
457
|
-
|
|
458
|
-
return data.createOrgUnit;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
export async function updateOrgUnit(input: {
|
|
462
|
-
readonly code: string | null;
|
|
463
|
-
readonly id: string;
|
|
464
|
-
readonly metadataJson: string | null;
|
|
465
|
-
readonly name: string | null;
|
|
466
|
-
readonly parentId: string | null;
|
|
467
|
-
readonly type: OrgUnitType | null;
|
|
468
|
-
}): Promise<OrgUnitRecord> {
|
|
469
|
-
const data = await requestGraphQl<UpdateOrgUnitMutationData>(
|
|
470
|
-
`mutation AdminUpdateOrgUnit($input: UpdateOrgUnitInput!) {
|
|
471
|
-
updateOrgUnit(input: $input) {
|
|
472
|
-
code
|
|
473
|
-
createdAt
|
|
474
|
-
deletedAt
|
|
475
|
-
id
|
|
476
|
-
name
|
|
477
|
-
parentId
|
|
478
|
-
path
|
|
479
|
-
type
|
|
480
|
-
updatedAt
|
|
481
|
-
}
|
|
482
|
-
}`,
|
|
483
|
-
{ input },
|
|
484
|
-
);
|
|
485
|
-
|
|
486
|
-
return data.updateOrgUnit;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
export async function deleteOrgUnit(id: string): Promise<boolean> {
|
|
490
|
-
const data = await requestGraphQl<DeleteOrgUnitMutationData>(
|
|
491
|
-
`mutation AdminDeleteOrgUnit($id: String!) {
|
|
492
|
-
deleteOrgUnit(id: $id)
|
|
493
|
-
}`,
|
|
494
|
-
{ id },
|
|
495
|
-
);
|
|
496
|
-
|
|
497
|
-
return data.deleteOrgUnit;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
export async function commitOrgUnitTreeDraft(input: {
|
|
501
|
-
readonly moves: readonly {
|
|
502
|
-
readonly baseUpdatedAt: string;
|
|
503
|
-
readonly id: string;
|
|
504
|
-
readonly parentId: string | null;
|
|
505
|
-
}[];
|
|
506
|
-
}): Promise<readonly OrgUnitRecord[]> {
|
|
507
|
-
const data = await requestGraphQl<CommitOrgUnitTreeDraftMutationData>(
|
|
508
|
-
`mutation AdminCommitOrgUnitTreeDraft($input: CommitOrgUnitTreeDraftInput!) {
|
|
509
|
-
commitOrgUnitTreeDraft(input: $input) {
|
|
510
|
-
orgUnits {
|
|
511
|
-
code
|
|
512
|
-
createdAt
|
|
513
|
-
deletedAt
|
|
514
|
-
id
|
|
515
|
-
name
|
|
516
|
-
parentId
|
|
517
|
-
path
|
|
518
|
-
type
|
|
519
|
-
updatedAt
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}`,
|
|
523
|
-
{ input },
|
|
524
|
-
);
|
|
525
|
-
|
|
526
|
-
return data.commitOrgUnitTreeDraft.orgUnits;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
export async function createPosition(input: {
|
|
530
|
-
readonly code: string;
|
|
531
|
-
readonly level: number;
|
|
532
|
-
readonly metadataJson: string;
|
|
533
|
-
readonly name: string;
|
|
534
|
-
}): Promise<PositionRecord> {
|
|
535
|
-
const data = await requestGraphQl<CreatePositionMutationData>(
|
|
536
|
-
`mutation AdminCreatePosition($input: CreatePositionInput!) {
|
|
537
|
-
createPosition(input: $input) {
|
|
538
|
-
code
|
|
539
|
-
createdAt
|
|
540
|
-
id
|
|
541
|
-
level
|
|
542
|
-
name
|
|
543
|
-
updatedAt
|
|
544
|
-
}
|
|
545
|
-
}`,
|
|
546
|
-
{ input },
|
|
547
|
-
);
|
|
548
|
-
|
|
549
|
-
return data.createPosition;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
export async function updatePosition(input: {
|
|
553
|
-
readonly code: string | null;
|
|
554
|
-
readonly id: string;
|
|
555
|
-
readonly level: number | null;
|
|
556
|
-
readonly metadataJson: string | null;
|
|
557
|
-
readonly name: string | null;
|
|
558
|
-
}): Promise<PositionRecord> {
|
|
559
|
-
const data = await requestGraphQl<UpdatePositionMutationData>(
|
|
560
|
-
`mutation AdminUpdatePosition($input: UpdatePositionInput!) {
|
|
561
|
-
updatePosition(input: $input) {
|
|
562
|
-
code
|
|
563
|
-
createdAt
|
|
564
|
-
id
|
|
565
|
-
level
|
|
566
|
-
name
|
|
567
|
-
updatedAt
|
|
568
|
-
}
|
|
569
|
-
}`,
|
|
570
|
-
{ input },
|
|
571
|
-
);
|
|
572
|
-
|
|
573
|
-
return data.updatePosition;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
export async function createMembership(input: {
|
|
577
|
-
readonly effectiveFrom: string;
|
|
578
|
-
readonly effectiveTo: string | null;
|
|
579
|
-
readonly isPrimary: boolean;
|
|
580
|
-
readonly memberId: string;
|
|
581
|
-
readonly orgUnitId: string;
|
|
582
|
-
readonly positionId: string | null;
|
|
583
|
-
}): Promise<MembershipRecord> {
|
|
584
|
-
const data = await requestGraphQl<CreateMembershipMutationData>(
|
|
585
|
-
`mutation AdminCreateMembership($input: CreateMembershipInput!) {
|
|
586
|
-
createMembership(input: $input) {
|
|
587
|
-
createdAt
|
|
588
|
-
effectiveFrom
|
|
589
|
-
effectiveTo
|
|
590
|
-
id
|
|
591
|
-
isPrimary
|
|
592
|
-
memberId
|
|
593
|
-
orgUnitId
|
|
594
|
-
positionId
|
|
595
|
-
updatedAt
|
|
596
|
-
}
|
|
597
|
-
}`,
|
|
598
|
-
{ input },
|
|
599
|
-
);
|
|
600
|
-
|
|
601
|
-
return data.createMembership;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
export async function updateMembership(input: {
|
|
605
|
-
readonly effectiveFrom: string | null;
|
|
606
|
-
readonly effectiveTo: string | null;
|
|
607
|
-
readonly id: string;
|
|
608
|
-
readonly isPrimary: boolean | null;
|
|
609
|
-
readonly orgUnitId: string | null;
|
|
610
|
-
readonly positionId: string | null;
|
|
611
|
-
}): Promise<MembershipRecord> {
|
|
612
|
-
const data = await requestGraphQl<UpdateMembershipMutationData>(
|
|
613
|
-
`mutation AdminUpdateMembership($input: UpdateMembershipInput!) {
|
|
614
|
-
updateMembership(input: $input) {
|
|
615
|
-
createdAt
|
|
616
|
-
effectiveFrom
|
|
617
|
-
effectiveTo
|
|
618
|
-
id
|
|
619
|
-
isPrimary
|
|
620
|
-
memberId
|
|
621
|
-
orgUnitId
|
|
622
|
-
positionId
|
|
623
|
-
updatedAt
|
|
624
|
-
}
|
|
625
|
-
}`,
|
|
626
|
-
{ input },
|
|
627
|
-
);
|
|
628
|
-
|
|
629
|
-
return data.updateMembership;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
export async function deleteMembership(id: string): Promise<boolean> {
|
|
633
|
-
const data = await requestGraphQl<DeleteMembershipMutationData>(
|
|
634
|
-
`mutation AdminDeleteMembership($id: String!) {
|
|
635
|
-
deleteMembership(id: $id)
|
|
636
|
-
}`,
|
|
637
|
-
{ id },
|
|
638
|
-
);
|
|
639
|
-
|
|
640
|
-
return data.deleteMembership;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
export async function createManagerResolution(input: {
|
|
644
|
-
readonly effectiveFrom: string;
|
|
645
|
-
readonly effectiveTo: string | null;
|
|
646
|
-
readonly managerMemberId: string;
|
|
647
|
-
readonly priority: number;
|
|
648
|
-
readonly scopeId: string;
|
|
649
|
-
readonly scopeType: ManagerResolutionScopeType;
|
|
650
|
-
}): Promise<ManagerResolutionRecord> {
|
|
651
|
-
const data = await requestGraphQl<CreateManagerResolutionMutationData>(
|
|
652
|
-
`mutation AdminCreateManagerResolution(
|
|
653
|
-
$input: CreateManagerResolutionInput!
|
|
654
|
-
) {
|
|
655
|
-
createManagerResolution(input: $input) {
|
|
656
|
-
createdAt
|
|
657
|
-
effectiveFrom
|
|
658
|
-
effectiveTo
|
|
659
|
-
id
|
|
660
|
-
managerMemberId
|
|
661
|
-
priority
|
|
662
|
-
scopeId
|
|
663
|
-
scopeType
|
|
664
|
-
}
|
|
665
|
-
}`,
|
|
666
|
-
{ input },
|
|
667
|
-
);
|
|
668
|
-
|
|
669
|
-
return data.createManagerResolution;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
export async function updateManagerResolution(input: {
|
|
673
|
-
readonly effectiveFrom: string | null;
|
|
674
|
-
readonly effectiveTo: string | null;
|
|
675
|
-
readonly id: string;
|
|
676
|
-
readonly managerMemberId: string | null;
|
|
677
|
-
readonly priority: number | null;
|
|
678
|
-
readonly scopeId: string | null;
|
|
679
|
-
readonly scopeType: ManagerResolutionScopeType | null;
|
|
680
|
-
}): Promise<ManagerResolutionRecord> {
|
|
681
|
-
const data = await requestGraphQl<UpdateManagerResolutionMutationData>(
|
|
682
|
-
`mutation AdminUpdateManagerResolution(
|
|
683
|
-
$input: UpdateManagerResolutionInput!
|
|
684
|
-
) {
|
|
685
|
-
updateManagerResolution(input: $input) {
|
|
686
|
-
createdAt
|
|
687
|
-
effectiveFrom
|
|
688
|
-
effectiveTo
|
|
689
|
-
id
|
|
690
|
-
managerMemberId
|
|
691
|
-
priority
|
|
692
|
-
scopeId
|
|
693
|
-
scopeType
|
|
694
|
-
}
|
|
695
|
-
}`,
|
|
696
|
-
{ input },
|
|
697
|
-
);
|
|
698
|
-
|
|
699
|
-
return data.updateManagerResolution;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
export async function deleteManagerResolution(id: string): Promise<boolean> {
|
|
703
|
-
const data = await requestGraphQl<DeleteManagerResolutionMutationData>(
|
|
704
|
-
`mutation AdminDeleteManagerResolution($id: String!) {
|
|
705
|
-
deleteManagerResolution(id: $id)
|
|
706
|
-
}`,
|
|
707
|
-
{ id },
|
|
708
|
-
);
|
|
709
|
-
|
|
710
|
-
return data.deleteManagerResolution;
|
|
711
|
-
}
|