@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
@@ -1,150 +0,0 @@
1
- import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
2
- import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
3
- export interface ApprovalTemplateRecord {
4
- readonly category: string | null;
5
- readonly categoryDetail: ApprovalTemplateCategoryRecord | null;
6
- readonly categoryId: string | null;
7
- readonly currentVersionId: string | null;
8
- readonly description: string | null;
9
- readonly id: string;
10
- readonly name: string;
11
- readonly updatedAt: string;
12
- }
13
- export type ApprovalTemplateListStatus = 'DRAFT' | 'PUBLISHED';
14
- export type ApprovalTemplateCategoryStatus = 'ACTIVE' | 'ALL' | 'INACTIVE';
15
- export interface ApprovalTemplateCategoryRecord {
16
- readonly createdAt: string;
17
- readonly description: string | null;
18
- readonly id: string;
19
- readonly isActive: boolean;
20
- readonly name: string;
21
- readonly sortOrder: number;
22
- readonly updatedAt: string;
23
- }
24
- export interface ApprovalTemplateVersionRecord {
25
- readonly archivedAt: string | null;
26
- readonly formDefinitionVersionId: string | null;
27
- readonly id: string;
28
- readonly initiatorPolicyCel: string | null;
29
- readonly notificationConfigJson: string | null;
30
- readonly publishedAt: string | null;
31
- readonly slaDefaultsJson: string | null;
32
- readonly status: 'ARCHIVED' | 'DRAFT' | 'PUBLISHED';
33
- readonly updatedAt: string;
34
- readonly version: number;
35
- readonly workflowDefinition: WorkflowDefinition;
36
- readonly workflowDefinitionJson: string;
37
- }
38
- export interface FormDefinitionRecord {
39
- readonly currentVersionId: string | null;
40
- readonly id: string;
41
- readonly name: string;
42
- readonly updatedAt: string;
43
- }
44
- export interface FormDefinitionVersionRecord {
45
- readonly formDefinitionId: string;
46
- readonly id: string;
47
- readonly publishedAt: string | null;
48
- readonly schema: FormDefinitionSchema;
49
- readonly schemaJson: string;
50
- readonly status: 'ARCHIVED' | 'DRAFT' | 'PUBLISHED';
51
- readonly version: number;
52
- }
53
- export interface PublishedFormVersionOption {
54
- readonly formDefinitionId: string;
55
- readonly formName: string;
56
- readonly id: string;
57
- readonly label: string;
58
- readonly schema: FormDefinitionSchema;
59
- readonly version: number;
60
- }
61
- export interface MemberProfileRecord {
62
- readonly email: string;
63
- readonly memberId: string;
64
- readonly name: string;
65
- }
66
- export interface WorkflowDryRunStepRecord {
67
- readonly assigneeMemberId: string | null;
68
- readonly edgeDefault: boolean | null;
69
- readonly edgeId: string | null;
70
- readonly edgeLabel: string | null;
71
- readonly edgeMatched: boolean | null;
72
- readonly edgeReason: string | null;
73
- readonly entryCondition: string | null;
74
- readonly entryConditionMatched: boolean | null;
75
- readonly id: string;
76
- readonly message: string;
77
- readonly nodeId: string;
78
- readonly nodeLabel: string;
79
- readonly nodeType: string;
80
- readonly status: string;
81
- }
82
- export interface WorkflowDryRunResultRecord {
83
- readonly errors: readonly string[];
84
- readonly steps: readonly WorkflowDryRunStepRecord[];
85
- readonly valid: boolean;
86
- }
87
- export interface TemplateDesignerRecord {
88
- readonly formVersions: readonly PublishedFormVersionOption[];
89
- readonly template: ApprovalTemplateRecord;
90
- readonly versions: readonly ApprovalTemplateVersionRecord[];
91
- }
92
- export interface ApprovalTemplatesPage {
93
- readonly templates: readonly ApprovalTemplateRecord[];
94
- readonly totalCount: number;
95
- }
96
- export interface ApprovalTemplateCategoriesPage {
97
- readonly categories: readonly ApprovalTemplateCategoryRecord[];
98
- readonly totalCount: number;
99
- }
100
- export declare function listApprovalTemplates(): Promise<readonly ApprovalTemplateRecord[]>;
101
- export declare function listApprovalTemplatesPage({ page, pageSize, searchText, status, categoryId, }: {
102
- readonly categoryId?: string | null;
103
- readonly page: number;
104
- readonly pageSize: number;
105
- readonly searchText?: string;
106
- readonly status?: ApprovalTemplateListStatus | null;
107
- }): Promise<ApprovalTemplatesPage>;
108
- export declare function listApprovalTemplateCategoriesPage({ page, pageSize, searchText, status, }: {
109
- readonly page: number;
110
- readonly pageSize: number;
111
- readonly searchText?: string;
112
- readonly status?: ApprovalTemplateCategoryStatus | null;
113
- }): Promise<ApprovalTemplateCategoriesPage>;
114
- export declare function createApprovalTemplate({ categoryId, name, }: {
115
- readonly categoryId: string | null;
116
- readonly name: string;
117
- }): Promise<string>;
118
- export declare function createApprovalTemplateCategory({ description, isActive, name, sortOrder, }: {
119
- readonly description: string | null;
120
- readonly isActive: boolean;
121
- readonly name: string;
122
- readonly sortOrder: number;
123
- }): Promise<ApprovalTemplateCategoryRecord>;
124
- export declare function updateApprovalTemplateCategory({ description, id, isActive, name, sortOrder, }: {
125
- readonly description: string | null;
126
- readonly id: string;
127
- readonly isActive: boolean;
128
- readonly name: string;
129
- readonly sortOrder: number;
130
- }): Promise<ApprovalTemplateCategoryRecord>;
131
- export declare function deleteApprovalTemplateCategory(id: string): Promise<void>;
132
- export declare function readTemplateDesigner(templateId: string): Promise<TemplateDesignerRecord>;
133
- export declare function searchPublishedFormVersionOptions(searchText: string): Promise<readonly PublishedFormVersionOption[]>;
134
- export declare function resolveMemberOptions(memberIds: readonly string[]): Promise<readonly MemberProfileRecord[]>;
135
- export declare function searchMemberOptions(searchText: string): Promise<readonly MemberProfileRecord[]>;
136
- export declare function updateApprovalTemplateDraft({ formDefinitionVersionId, initiatorPolicyCel, versionId, workflowDefinition, }: {
137
- readonly formDefinitionVersionId: string | null;
138
- readonly initiatorPolicyCel: string | null;
139
- readonly versionId: string;
140
- readonly workflowDefinition: WorkflowDefinition;
141
- }): Promise<ApprovalTemplateVersionRecord>;
142
- export declare function forkApprovalTemplate(templateId: string): Promise<ApprovalTemplateVersionRecord>;
143
- export declare function publishApprovalTemplateVersion(versionId: string): Promise<ApprovalTemplateVersionRecord>;
144
- export declare function rollbackApprovalTemplateVersion(versionId: string): Promise<ApprovalTemplateVersionRecord>;
145
- export declare function dryRunApprovalWorkflow({ formData, initiatorMemberId, initiatorMetadataSnapshot, workflowDefinition, }: {
146
- readonly formData: Readonly<Record<string, unknown>>;
147
- readonly initiatorMemberId: string;
148
- readonly initiatorMetadataSnapshot: Readonly<Record<string, unknown>> | null;
149
- readonly workflowDefinition: WorkflowDefinition;
150
- }): Promise<WorkflowDryRunResultRecord>;
@@ -1,407 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listApprovalTemplates = listApprovalTemplates;
4
- exports.listApprovalTemplatesPage = listApprovalTemplatesPage;
5
- exports.listApprovalTemplateCategoriesPage = listApprovalTemplateCategoriesPage;
6
- exports.createApprovalTemplate = createApprovalTemplate;
7
- exports.createApprovalTemplateCategory = createApprovalTemplateCategory;
8
- exports.updateApprovalTemplateCategory = updateApprovalTemplateCategory;
9
- exports.deleteApprovalTemplateCategory = deleteApprovalTemplateCategory;
10
- exports.readTemplateDesigner = readTemplateDesigner;
11
- exports.searchPublishedFormVersionOptions = searchPublishedFormVersionOptions;
12
- exports.resolveMemberOptions = resolveMemberOptions;
13
- exports.searchMemberOptions = searchMemberOptions;
14
- exports.updateApprovalTemplateDraft = updateApprovalTemplateDraft;
15
- exports.forkApprovalTemplate = forkApprovalTemplate;
16
- exports.publishApprovalTemplateVersion = publishApprovalTemplateVersion;
17
- exports.rollbackApprovalTemplateVersion = rollbackApprovalTemplateVersion;
18
- exports.dryRunApprovalWorkflow = dryRunApprovalWorkflow;
19
- const graphql_client_1 = require("../graphql-client");
20
- async function listApprovalTemplates() {
21
- const data = await (0, graphql_client_1.requestGraphQl)(`query ApprovalTemplates {
22
- approvalTemplates {
23
- category
24
- categoryId
25
- categoryDetail {
26
- id
27
- isActive
28
- name
29
- }
30
- currentVersionId
31
- description
32
- id
33
- name
34
- updatedAt
35
- }
36
- }`);
37
- return data.approvalTemplates;
38
- }
39
- async function listApprovalTemplatesPage({ page, pageSize, searchText, status, categoryId, }) {
40
- const data = await (0, graphql_client_1.requestGraphQl)(`query ApprovalTemplatesPage(
41
- $page: Int
42
- $pageSize: Int
43
- $searchText: String
44
- $status: ApprovalTemplateListStatus
45
- $categoryId: String
46
- ) {
47
- approvalTemplates(
48
- categoryId: $categoryId
49
- page: $page
50
- pageSize: $pageSize
51
- searchText: $searchText
52
- status: $status
53
- ) {
54
- category
55
- categoryId
56
- categoryDetail {
57
- id
58
- isActive
59
- name
60
- }
61
- currentVersionId
62
- description
63
- id
64
- name
65
- updatedAt
66
- }
67
- approvalTemplateCount(
68
- categoryId: $categoryId
69
- searchText: $searchText
70
- status: $status
71
- )
72
- }`, {
73
- categoryId: categoryId ?? null,
74
- page,
75
- pageSize,
76
- searchText,
77
- status: status ?? null,
78
- });
79
- return {
80
- templates: data.approvalTemplates,
81
- totalCount: data.approvalTemplateCount,
82
- };
83
- }
84
- async function listApprovalTemplateCategoriesPage({ page, pageSize, searchText, status, }) {
85
- const data = await (0, graphql_client_1.requestGraphQl)(`query ApprovalTemplateCategoriesPage(
86
- $page: Int
87
- $pageSize: Int
88
- $searchText: String
89
- $status: ApprovalTemplateCategoryStatus
90
- ) {
91
- approvalTemplateCategories(
92
- page: $page
93
- pageSize: $pageSize
94
- searchText: $searchText
95
- status: $status
96
- ) {
97
- createdAt
98
- description
99
- id
100
- isActive
101
- name
102
- sortOrder
103
- updatedAt
104
- }
105
- approvalTemplateCategoryCount(
106
- searchText: $searchText
107
- status: $status
108
- )
109
- }`, { page, pageSize, searchText, status: status ?? null });
110
- return {
111
- categories: data.approvalTemplateCategories,
112
- totalCount: data.approvalTemplateCategoryCount,
113
- };
114
- }
115
- async function createApprovalTemplate({ categoryId, name, }) {
116
- const data = await (0, graphql_client_1.requestGraphQl)(`mutation CreateApprovalTemplate($input: CreateApprovalTemplateInput!) {
117
- createApprovalTemplate(input: $input) {
118
- id
119
- }
120
- }`, {
121
- input: {
122
- category: null,
123
- categoryId,
124
- createdByMemberId: null,
125
- description: null,
126
- formDefinitionVersionId: null,
127
- name,
128
- },
129
- });
130
- return data.createApprovalTemplate.id;
131
- }
132
- async function createApprovalTemplateCategory({ description, isActive, name, sortOrder, }) {
133
- const data = await (0, graphql_client_1.requestGraphQl)(`mutation CreateApprovalTemplateCategory($input: CreateApprovalTemplateCategoryInput!) {
134
- createApprovalTemplateCategory(input: $input) {
135
- createdAt
136
- description
137
- id
138
- isActive
139
- name
140
- sortOrder
141
- updatedAt
142
- }
143
- }`, { input: { description, isActive, name, sortOrder } });
144
- return data.createApprovalTemplateCategory;
145
- }
146
- async function updateApprovalTemplateCategory({ description, id, isActive, name, sortOrder, }) {
147
- const data = await (0, graphql_client_1.requestGraphQl)(`mutation UpdateApprovalTemplateCategory($input: UpdateApprovalTemplateCategoryInput!) {
148
- updateApprovalTemplateCategory(input: $input) {
149
- createdAt
150
- description
151
- id
152
- isActive
153
- name
154
- sortOrder
155
- updatedAt
156
- }
157
- }`, { input: { description, id, isActive, name, sortOrder } });
158
- return data.updateApprovalTemplateCategory;
159
- }
160
- async function deleteApprovalTemplateCategory(id) {
161
- await (0, graphql_client_1.requestGraphQl)(`mutation DeleteApprovalTemplateCategory($id: String!) {
162
- deleteApprovalTemplateCategory(id: $id) {
163
- id
164
- }
165
- }`, { id });
166
- }
167
- async function readTemplateDesigner(templateId) {
168
- const data = await (0, graphql_client_1.requestGraphQl)(`query TemplateDesigner($id: String!) {
169
- approvalTemplate(id: $id) {
170
- category
171
- categoryId
172
- categoryDetail {
173
- id
174
- isActive
175
- name
176
- }
177
- currentVersionId
178
- description
179
- id
180
- name
181
- updatedAt
182
- }
183
- approvalTemplateVersions(templateId: $id) {
184
- archivedAt
185
- formDefinitionVersionId
186
- id
187
- initiatorPolicyCel
188
- notificationConfigJson
189
- publishedAt
190
- slaDefaultsJson
191
- status
192
- updatedAt
193
- version
194
- workflowDefinitionJson
195
- }
196
- formDefinitions {
197
- currentVersionId
198
- id
199
- name
200
- updatedAt
201
- }
202
- }`, { id: templateId });
203
- const formVersionLists = await Promise.all(data.formDefinitions.map((definition) => readFormDefinitionVersions(definition.id)));
204
- return {
205
- formVersions: data.formDefinitions.flatMap((definition, index) => formVersionLists[index]
206
- .filter((version) => version.status === 'PUBLISHED')
207
- .map((version) => ({
208
- formDefinitionId: definition.id,
209
- formName: definition.name,
210
- id: version.id,
211
- label: `${definition.name} v${version.version}`,
212
- schema: version.schema,
213
- version: version.version,
214
- }))),
215
- template: data.approvalTemplate,
216
- versions: data.approvalTemplateVersions.map(parseVersionJson),
217
- };
218
- }
219
- async function searchPublishedFormVersionOptions(searchText) {
220
- const data = await (0, graphql_client_1.requestGraphQl)(`query PublishedFormVersionOptions {
221
- formDefinitions {
222
- currentVersionId
223
- id
224
- name
225
- updatedAt
226
- }
227
- }`);
228
- const normalizedSearchText = searchText.trim().toLocaleLowerCase();
229
- const matchedDefinitions = data.formDefinitions.filter((definition) => normalizedSearchText
230
- ? definition.name.toLocaleLowerCase().includes(normalizedSearchText)
231
- : true);
232
- const formVersionLists = await Promise.all(matchedDefinitions.map((definition) => readFormDefinitionVersions(definition.id)));
233
- return matchedDefinitions.flatMap((definition, index) => formVersionLists[index]
234
- .filter((version) => version.status === 'PUBLISHED')
235
- .map((version) => ({
236
- formDefinitionId: definition.id,
237
- formName: definition.name,
238
- id: version.id,
239
- label: `${definition.name} v${version.version}`,
240
- schema: version.schema,
241
- version: version.version,
242
- })));
243
- }
244
- async function resolveMemberOptions(memberIds) {
245
- if (memberIds.length === 0) {
246
- return [];
247
- }
248
- const data = await (0, graphql_client_1.requestGraphQl)(`query SelectedMembers($memberIds: [String!]!) {
249
- members(memberIds: $memberIds) {
250
- email
251
- memberId
252
- name
253
- }
254
- }`, { memberIds });
255
- return data.members;
256
- }
257
- async function searchMemberOptions(searchText) {
258
- const data = await (0, graphql_client_1.requestGraphQl)(`query MemberOptions($searchText: String!) {
259
- searchMembers(searchText: $searchText) {
260
- email
261
- memberId
262
- name
263
- }
264
- }`, { searchText });
265
- return data.searchMembers;
266
- }
267
- async function updateApprovalTemplateDraft({ formDefinitionVersionId, initiatorPolicyCel, versionId, workflowDefinition, }) {
268
- const data = await (0, graphql_client_1.requestGraphQl)(`mutation UpdateApprovalTemplateDraft($input: UpdateApprovalTemplateDraftInput!) {
269
- updateApprovalTemplateDraft(input: $input) {
270
- archivedAt
271
- formDefinitionVersionId
272
- id
273
- initiatorPolicyCel
274
- notificationConfigJson
275
- publishedAt
276
- slaDefaultsJson
277
- status
278
- updatedAt
279
- version
280
- workflowDefinitionJson
281
- }
282
- }`, {
283
- input: {
284
- formDefinitionVersionId,
285
- initiatorPolicyCel,
286
- notificationConfigJson: null,
287
- slaDefaultsJson: null,
288
- versionId,
289
- workflowDefinitionJson: JSON.stringify(workflowDefinition),
290
- },
291
- });
292
- return parseVersionJson(data.updateApprovalTemplateDraft);
293
- }
294
- async function forkApprovalTemplate(templateId) {
295
- const data = await (0, graphql_client_1.requestGraphQl)(`mutation ForkApprovalTemplate($templateId: String!) {
296
- forkApprovalTemplate(templateId: $templateId) {
297
- archivedAt
298
- formDefinitionVersionId
299
- id
300
- initiatorPolicyCel
301
- notificationConfigJson
302
- publishedAt
303
- slaDefaultsJson
304
- status
305
- updatedAt
306
- version
307
- workflowDefinitionJson
308
- }
309
- }`, { templateId });
310
- return parseVersionJson(data.forkApprovalTemplate);
311
- }
312
- async function publishApprovalTemplateVersion(versionId) {
313
- const data = await (0, graphql_client_1.requestGraphQl)(`mutation PublishApprovalTemplateVersion($versionId: String!) {
314
- publishApprovalTemplateVersion(versionId: $versionId) {
315
- archivedAt
316
- formDefinitionVersionId
317
- id
318
- initiatorPolicyCel
319
- notificationConfigJson
320
- publishedAt
321
- slaDefaultsJson
322
- status
323
- updatedAt
324
- version
325
- workflowDefinitionJson
326
- }
327
- }`, { versionId });
328
- return parseVersionJson(data.publishApprovalTemplateVersion);
329
- }
330
- async function rollbackApprovalTemplateVersion(versionId) {
331
- const data = await (0, graphql_client_1.requestGraphQl)(`mutation RollbackApprovalTemplateVersion($versionId: String!) {
332
- rollbackApprovalTemplateVersion(versionId: $versionId) {
333
- archivedAt
334
- formDefinitionVersionId
335
- id
336
- initiatorPolicyCel
337
- notificationConfigJson
338
- publishedAt
339
- slaDefaultsJson
340
- status
341
- updatedAt
342
- version
343
- workflowDefinitionJson
344
- }
345
- }`, { versionId });
346
- return parseVersionJson(data.rollbackApprovalTemplateVersion);
347
- }
348
- async function dryRunApprovalWorkflow({ formData, initiatorMemberId, initiatorMetadataSnapshot, workflowDefinition, }) {
349
- const data = await (0, graphql_client_1.requestGraphQl)(`mutation DryRunApprovalWorkflow($input: DryRunApprovalWorkflowInput!) {
350
- dryRunApprovalWorkflow(input: $input) {
351
- errors
352
- valid
353
- steps {
354
- assigneeMemberId
355
- edgeDefault
356
- edgeId
357
- edgeLabel
358
- edgeMatched
359
- edgeReason
360
- entryCondition
361
- entryConditionMatched
362
- id
363
- message
364
- nodeId
365
- nodeLabel
366
- nodeType
367
- status
368
- }
369
- }
370
- }`, {
371
- input: {
372
- formDataJson: JSON.stringify(formData),
373
- initiatorMemberId,
374
- initiatorMetadataSnapshotJson: initiatorMetadataSnapshot
375
- ? JSON.stringify(initiatorMetadataSnapshot)
376
- : null,
377
- workflowDefinitionJson: JSON.stringify(workflowDefinition),
378
- },
379
- });
380
- return data.dryRunApprovalWorkflow;
381
- }
382
- async function readFormDefinitionVersions(formDefinitionId) {
383
- const data = await (0, graphql_client_1.requestGraphQl)(`query FormVersions($formDefinitionId: String!) {
384
- formDefinitionVersions(formDefinitionId: $formDefinitionId) {
385
- formDefinitionId
386
- id
387
- publishedAt
388
- schemaJson
389
- status
390
- version
391
- }
392
- }`, { formDefinitionId });
393
- return data.formDefinitionVersions.map((version) => ({
394
- ...version,
395
- schema: parseFormDefinitionSchema(version.schemaJson),
396
- }));
397
- }
398
- function parseVersionJson(version) {
399
- return {
400
- ...version,
401
- workflowDefinition: JSON.parse(version.workflowDefinitionJson),
402
- };
403
- }
404
- function parseFormDefinitionSchema(schemaJson) {
405
- return JSON.parse(schemaJson);
406
- }
407
- //# sourceMappingURL=template-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-api.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/template/template-api.ts"],"names":[],"mappings":";;AA+LA,sDAuBC;AAED,8DA4DC;AAED,gFA4CC;AAED,wDA0BC;AAED,wEA2BC;AAED,wEA6BC;AAED,wEAWC;AAED,oDA+DC;AAED,8EAuCC;AAED,oDAmBC;AAED,kDAeC;AAED,kEAwCC;AAED,oDAuBC;AAED,wEAuBC;AAED,0EAuBC;AAED,wDA+CC;AA3tBD,sDAAmD;AA6L5C,KAAK,UAAU,qBAAqB;IAGzC,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAc,EAC/B;;;;;;;;;;;;;;;MAeE,CACH,CAAC;IAEF,OAAO,IAAI,CAAC,iBAAiB,CAAC;AAChC,CAAC;AAEM,KAAK,UAAU,yBAAyB,CAAC,EAC9C,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,MAAM,EACN,UAAU,GAOX;IACC,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAc,EAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCE,EACF;QACE,UAAU,E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CAAC;QACnD,GAAG,OAAO;QACV,MAAM,EAAE,yBAAyB,CAAC,OAAO,CAAC,UAAU,CAAC;KACtD,CAAC,CAAC,CAAC;AACN,CAAC;AAED,SAAS,gBAAgB,CACvB,OAA0B;IAE1B,OAAO;QACL,GAAG,OAAO;QACV,kBAAkB,EAAE,IAAI,CAAC,KAAK,CAC5B,OAAO,CAAC,sBAAsB,CACT;KACxB,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAAC,UAAkB;IACnD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAyB,CAAC;AACxD,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("./workflow-api"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core-client/src/lib/workflow/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B"}