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