@rytass/bpm-core-client 0.5.0 → 0.6.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.
- package/CHANGELOG.md +28 -0
- package/package.json +4 -3
- 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 +351 -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
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
import { FormDefinitionSchema, FormFieldValue, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
2
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
+
export type ApprovalInstanceState = 'APPROVED' | 'CANCELLED' | 'DRAFT' | 'EXPIRED' | 'REJECTED' | 'RETURNED' | 'RUNNING';
|
|
4
|
+
export type TaskStatus = 'CANCELLED' | 'COMPLETED' | 'IN_PROGRESS' | 'PENDING' | 'TRANSFERRED';
|
|
5
|
+
export type TaskAssignmentType = 'CANDIDATE_GROUP' | 'DIRECT_MEMBER';
|
|
6
|
+
export type TaskDecisionAction = 'APPROVED' | 'REJECTED' | 'RETURNED' | 'TRANSFERRED';
|
|
7
|
+
export type AdhocDirectiveType = 'COMPLETION_NOTIFY' | 'COUNTERSIGN' | 'PRE_APPROVAL' | 'STAGE_NOTIFY';
|
|
8
|
+
export type AdhocDirectiveStatus = 'CANCELLED' | 'CONSUMED' | 'PENDING';
|
|
9
|
+
export type AdhocTargetKind = 'MEMBER' | 'ORG_UNIT_MEMBER' | 'POSITION' | 'WEBHOOK';
|
|
10
|
+
export type AdhocPreApprovalRejectBehavior = 'REJECT_INSTANCE' | 'RETURN_TO_ORIGIN';
|
|
11
|
+
/**
|
|
12
|
+
* Polymorphic target of an ad-hoc directive. Set exactly the fields matching
|
|
13
|
+
* `kind`:
|
|
14
|
+
*
|
|
15
|
+
* - `MEMBER` → `memberIds`
|
|
16
|
+
* - `POSITION` → `positionId`
|
|
17
|
+
* - `ORG_UNIT_MEMBER` → `orgUnitId` (+ optional `includeDescendants`)
|
|
18
|
+
* - `WEBHOOK` → `webhookUrl` (+ optional `webhookHeaders`); only valid for
|
|
19
|
+
* the notification directives, never as countersign / pre-approval signers.
|
|
20
|
+
*/
|
|
21
|
+
export interface AdhocTargetOptions {
|
|
22
|
+
readonly includeDescendants?: boolean;
|
|
23
|
+
readonly kind: AdhocTargetKind;
|
|
24
|
+
readonly memberIds?: readonly string[];
|
|
25
|
+
readonly orgUnitId?: string;
|
|
26
|
+
readonly positionId?: string;
|
|
27
|
+
readonly webhookHeaders?: Readonly<Record<string, string>>;
|
|
28
|
+
readonly webhookUrl?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An instance-scoped ad-hoc directive recorded by a stage approver. Directives
|
|
32
|
+
* never modify the workflow template — they only affect the single approval
|
|
33
|
+
* instance they were created on. `status` lifecycle: `PENDING` (waiting for
|
|
34
|
+
* its trigger) → `CONSUMED` (effect applied / notification sent) or
|
|
35
|
+
* `CANCELLED` (withdrawn, or dropped by a return / reject / cancel).
|
|
36
|
+
*/
|
|
37
|
+
export interface AdhocDirectiveRecord {
|
|
38
|
+
readonly channels: readonly NotificationChannel[] | null;
|
|
39
|
+
readonly comment: string | null;
|
|
40
|
+
readonly consumedAt: string | null;
|
|
41
|
+
readonly createdAt: string;
|
|
42
|
+
readonly createdByMemberId: string;
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly instanceId: string;
|
|
45
|
+
readonly onReject: AdhocPreApprovalRejectBehavior | null;
|
|
46
|
+
readonly originNodeId: string;
|
|
47
|
+
readonly originTaskId: string;
|
|
48
|
+
readonly status: AdhocDirectiveStatus;
|
|
49
|
+
readonly targetKind: AdhocTargetKind;
|
|
50
|
+
readonly targetValueJson: string;
|
|
51
|
+
readonly type: AdhocDirectiveType;
|
|
52
|
+
}
|
|
53
|
+
export interface ApprovalInstanceRecord {
|
|
54
|
+
readonly completedAt: string | null;
|
|
55
|
+
readonly formData: WorkflowFormData;
|
|
56
|
+
readonly formDataJson: string;
|
|
57
|
+
readonly formDefinitionSnapshot: FormDefinitionSnapshot;
|
|
58
|
+
readonly formDefinitionSnapshotJson: string;
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly initiatorMemberId: string;
|
|
61
|
+
readonly startedAt: string;
|
|
62
|
+
readonly state: ApprovalInstanceState;
|
|
63
|
+
readonly templateId: string;
|
|
64
|
+
readonly templateVersionId: string;
|
|
65
|
+
readonly title: string;
|
|
66
|
+
readonly workflowSnapshot: WorkflowDefinition;
|
|
67
|
+
readonly workflowSnapshotJson: string;
|
|
68
|
+
}
|
|
69
|
+
export interface FormDefinitionSnapshot {
|
|
70
|
+
readonly formDefinitionVersionId?: string;
|
|
71
|
+
readonly schema?: FormDefinitionSchema;
|
|
72
|
+
readonly uiSchema?: FormUiSchema;
|
|
73
|
+
readonly version?: number;
|
|
74
|
+
}
|
|
75
|
+
export type WorkflowFormData = Readonly<Record<string, FormFieldValue | undefined>>;
|
|
76
|
+
export interface TaskRecord {
|
|
77
|
+
readonly adhocDirectiveId: string | null;
|
|
78
|
+
readonly adhocOriginTaskId: string | null;
|
|
79
|
+
readonly adhocType: AdhocDirectiveType | null;
|
|
80
|
+
readonly assigneeMemberId: string | null;
|
|
81
|
+
readonly assignmentType: TaskAssignmentType;
|
|
82
|
+
readonly candidateMemberIds: readonly string[];
|
|
83
|
+
readonly completedAt: string | null;
|
|
84
|
+
readonly createdAt: string;
|
|
85
|
+
readonly decisionPolicySnapshotJson: string;
|
|
86
|
+
readonly delegationChainJson: string;
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly instanceId: string;
|
|
89
|
+
readonly isAdhoc: boolean;
|
|
90
|
+
readonly nodeId: string;
|
|
91
|
+
readonly openedAt: string | null;
|
|
92
|
+
readonly originalAssigneeMemberId: string | null;
|
|
93
|
+
readonly slaDueAt: string | null;
|
|
94
|
+
readonly status: TaskStatus;
|
|
95
|
+
readonly tokenId: string;
|
|
96
|
+
}
|
|
97
|
+
export interface TaskCandidateRecord {
|
|
98
|
+
readonly claimedAt: string | null;
|
|
99
|
+
readonly createdAt: string;
|
|
100
|
+
readonly decidedAt: string | null;
|
|
101
|
+
readonly delegationChainJson: string;
|
|
102
|
+
readonly id: string;
|
|
103
|
+
readonly memberId: string;
|
|
104
|
+
readonly originalMemberId: string;
|
|
105
|
+
readonly sourceType: string;
|
|
106
|
+
readonly status: string;
|
|
107
|
+
readonly taskId: string;
|
|
108
|
+
}
|
|
109
|
+
export interface WorkflowTokenRecord {
|
|
110
|
+
readonly consumedAt: string | null;
|
|
111
|
+
readonly createdAt: string;
|
|
112
|
+
readonly currentNodeId: string;
|
|
113
|
+
readonly id: string;
|
|
114
|
+
readonly instanceId: string;
|
|
115
|
+
readonly parentTokenId: string | null;
|
|
116
|
+
readonly status: 'ACTIVE' | 'CONSUMED' | 'WAITING';
|
|
117
|
+
}
|
|
118
|
+
export interface TaskDecisionRecord {
|
|
119
|
+
readonly action: TaskDecisionAction;
|
|
120
|
+
readonly comment: string | null;
|
|
121
|
+
readonly decidedAt: string;
|
|
122
|
+
readonly decidedByMemberId: string;
|
|
123
|
+
readonly id: string;
|
|
124
|
+
readonly returnToNodeId: string | null;
|
|
125
|
+
readonly signatureId: string | null;
|
|
126
|
+
readonly taskId: string;
|
|
127
|
+
readonly transferToMemberId: string | null;
|
|
128
|
+
}
|
|
129
|
+
export interface ActivityLogRecord {
|
|
130
|
+
readonly actorMemberId: string | null;
|
|
131
|
+
readonly createdAt: string;
|
|
132
|
+
readonly eventType: string;
|
|
133
|
+
readonly id: string;
|
|
134
|
+
readonly nodeId: string | null;
|
|
135
|
+
readonly payloadJson: string;
|
|
136
|
+
readonly taskId: string | null;
|
|
137
|
+
}
|
|
138
|
+
export interface MemberProfileRecord {
|
|
139
|
+
readonly email: string;
|
|
140
|
+
readonly memberId: string;
|
|
141
|
+
readonly name: string;
|
|
142
|
+
}
|
|
143
|
+
export interface MemberDirectoryPage {
|
|
144
|
+
readonly members: readonly MemberProfileRecord[];
|
|
145
|
+
readonly totalCount: number;
|
|
146
|
+
}
|
|
147
|
+
export type DelegationScopeType = 'ALL' | 'CONDITION_BASED' | 'TEMPLATE_LIST';
|
|
148
|
+
export type DelegationRuleStatus = 'ACTIVE' | 'EXPIRED' | 'REVOKED';
|
|
149
|
+
export type NotificationChannel = 'EMAIL' | 'IN_APP' | 'WEBHOOK';
|
|
150
|
+
export type NotificationDigestMode = 'DAILY' | 'INSTANT';
|
|
151
|
+
export type NotificationStatus = 'FAILED' | 'PENDING' | 'READ' | 'SENT';
|
|
152
|
+
export type NotificationType = 'INSTANCE_COMPLETED' | 'SLA_OVERDUE' | 'SLA_WARNING' | 'TASK_ASSIGNED' | 'TASK_TRANSFERRED';
|
|
153
|
+
export type NotificationResolution = 'APPROVED' | 'REJECTED' | 'RETURNED' | 'SUPERSEDED' | 'TRANSFERRED';
|
|
154
|
+
export interface NotificationRecord {
|
|
155
|
+
/**
|
|
156
|
+
* Whether the recipient can still act on this notification (an unresolved
|
|
157
|
+
* task assignment). Server-derived; drives the inline 同意/拒絕 actions.
|
|
158
|
+
*/
|
|
159
|
+
readonly actionable: boolean;
|
|
160
|
+
readonly attemptCount: number;
|
|
161
|
+
readonly body: string;
|
|
162
|
+
readonly channel: NotificationChannel;
|
|
163
|
+
readonly createdAt: string;
|
|
164
|
+
readonly deliveredAt: string | null;
|
|
165
|
+
readonly deliveryError: string | null;
|
|
166
|
+
readonly deliveryTarget: string | null;
|
|
167
|
+
readonly id: string;
|
|
168
|
+
readonly instanceId: string | null;
|
|
169
|
+
readonly lastAttemptAt: string | null;
|
|
170
|
+
readonly nextRetryAt: string | null;
|
|
171
|
+
readonly payloadJson: string;
|
|
172
|
+
readonly readAt: string | null;
|
|
173
|
+
readonly recipientMemberId: string;
|
|
174
|
+
/** How an actionable notification was resolved; `null` while still open. */
|
|
175
|
+
readonly resolution: NotificationResolution | null;
|
|
176
|
+
readonly resolvedAt: string | null;
|
|
177
|
+
readonly sentAt: string | null;
|
|
178
|
+
readonly status: NotificationStatus;
|
|
179
|
+
readonly taskId: string | null;
|
|
180
|
+
readonly title: string;
|
|
181
|
+
readonly type: NotificationType;
|
|
182
|
+
}
|
|
183
|
+
export interface NotificationPreferenceRecord {
|
|
184
|
+
readonly emailDigestMode: NotificationDigestMode;
|
|
185
|
+
readonly emailEnabled: boolean;
|
|
186
|
+
readonly inAppEnabled: boolean;
|
|
187
|
+
readonly memberId: string;
|
|
188
|
+
readonly quietHoursEnd: string | null;
|
|
189
|
+
readonly quietHoursStart: string | null;
|
|
190
|
+
readonly updatedAt: string;
|
|
191
|
+
}
|
|
192
|
+
export interface DelegationRuleRecord {
|
|
193
|
+
readonly agentMemberId: string;
|
|
194
|
+
readonly createdAt: string;
|
|
195
|
+
readonly createdByMemberId: string | null;
|
|
196
|
+
readonly endAt: string | null;
|
|
197
|
+
readonly id: string;
|
|
198
|
+
readonly principalMemberId: string;
|
|
199
|
+
readonly priority: number;
|
|
200
|
+
readonly requiresConfirmation: boolean;
|
|
201
|
+
readonly revokedAt: string | null;
|
|
202
|
+
readonly revokedByMemberId: string | null;
|
|
203
|
+
readonly scopeConditionCel: string | null;
|
|
204
|
+
readonly scopeTemplateIds: readonly string[];
|
|
205
|
+
readonly scopeType: DelegationScopeType;
|
|
206
|
+
readonly startAt: string;
|
|
207
|
+
readonly status: DelegationRuleStatus;
|
|
208
|
+
readonly updatedAt: string;
|
|
209
|
+
}
|
|
210
|
+
export interface AttachmentRecord {
|
|
211
|
+
readonly checksumSha256: string;
|
|
212
|
+
readonly createdAt: string;
|
|
213
|
+
readonly filename: string;
|
|
214
|
+
readonly formFieldPath: string | null;
|
|
215
|
+
readonly id: string;
|
|
216
|
+
readonly instanceId: string | null;
|
|
217
|
+
readonly mimeType: string;
|
|
218
|
+
readonly sizeBytes: string;
|
|
219
|
+
readonly storageKey: string;
|
|
220
|
+
readonly storageProvider: string;
|
|
221
|
+
readonly taskId: string | null;
|
|
222
|
+
readonly uploaderMemberId: string;
|
|
223
|
+
}
|
|
224
|
+
export interface SignatureRecord {
|
|
225
|
+
readonly algorithm: string;
|
|
226
|
+
readonly id: string;
|
|
227
|
+
readonly instanceId: string;
|
|
228
|
+
readonly keyVersion: number;
|
|
229
|
+
readonly previousSignatureHash: string | null;
|
|
230
|
+
readonly signature: string;
|
|
231
|
+
readonly signedAt: string;
|
|
232
|
+
readonly signedPayloadHash: string;
|
|
233
|
+
readonly signedPayloadJson: string;
|
|
234
|
+
readonly signerMemberId: string;
|
|
235
|
+
readonly taskId: string | null;
|
|
236
|
+
readonly timestampTokenBase64: string | null;
|
|
237
|
+
}
|
|
238
|
+
export interface SignatureVerificationRecord {
|
|
239
|
+
readonly checkedCount: number;
|
|
240
|
+
readonly errors: readonly string[];
|
|
241
|
+
readonly instanceId: string;
|
|
242
|
+
readonly valid: boolean;
|
|
243
|
+
}
|
|
244
|
+
export interface ApprovalTemplateRecord {
|
|
245
|
+
readonly currentVersionId: string | null;
|
|
246
|
+
readonly id: string;
|
|
247
|
+
readonly name: string;
|
|
248
|
+
readonly updatedAt?: string;
|
|
249
|
+
}
|
|
250
|
+
export interface ApprovalTemplateVersionRecord {
|
|
251
|
+
readonly formDefinitionVersionId: string | null;
|
|
252
|
+
readonly id: string;
|
|
253
|
+
readonly status: 'ARCHIVED' | 'DRAFT' | 'PUBLISHED';
|
|
254
|
+
readonly version: number;
|
|
255
|
+
}
|
|
256
|
+
export interface LaunchContext {
|
|
257
|
+
readonly formVersion: {
|
|
258
|
+
readonly id: string;
|
|
259
|
+
readonly schema: FormDefinitionSchema;
|
|
260
|
+
readonly uiSchema: FormUiSchema;
|
|
261
|
+
readonly version: number;
|
|
262
|
+
};
|
|
263
|
+
readonly template: ApprovalTemplateRecord;
|
|
264
|
+
readonly templateVersion: ApprovalTemplateVersionRecord;
|
|
265
|
+
}
|
|
266
|
+
export interface LaunchableTemplateRecord {
|
|
267
|
+
readonly currentVersionId: string;
|
|
268
|
+
readonly formDefinitionVersionId: string;
|
|
269
|
+
readonly id: string;
|
|
270
|
+
readonly name: string;
|
|
271
|
+
readonly updatedAt: string;
|
|
272
|
+
readonly version: number;
|
|
273
|
+
}
|
|
274
|
+
export type ApprovalInstanceView = 'ALL' | 'CC' | 'SENT';
|
|
275
|
+
export interface ApprovalInstancesPageInput {
|
|
276
|
+
readonly page: number;
|
|
277
|
+
readonly pageSize: number;
|
|
278
|
+
readonly searchText: string | null;
|
|
279
|
+
readonly state: ApprovalInstanceState | null;
|
|
280
|
+
readonly templateId: string | null;
|
|
281
|
+
readonly view: ApprovalInstanceView;
|
|
282
|
+
}
|
|
283
|
+
export interface ApprovalInstancesPageResult {
|
|
284
|
+
readonly instances: readonly ApprovalInstanceRecord[];
|
|
285
|
+
readonly pageInfo: ApprovalInstancePageInfoRecord;
|
|
286
|
+
readonly totalCount: number;
|
|
287
|
+
}
|
|
288
|
+
export interface ApprovalInstancePageInfoRecord {
|
|
289
|
+
readonly hasNextPage: boolean;
|
|
290
|
+
readonly hasPreviousPage: boolean;
|
|
291
|
+
readonly page: number;
|
|
292
|
+
readonly pageSize: number;
|
|
293
|
+
readonly totalCount: number;
|
|
294
|
+
readonly totalPages: number;
|
|
295
|
+
}
|
|
296
|
+
export interface WorkflowDashboardSummaryRecord {
|
|
297
|
+
readonly activeInstanceCount: number;
|
|
298
|
+
readonly completedInstanceCount: number;
|
|
299
|
+
readonly overdueTaskCount: number;
|
|
300
|
+
readonly pendingTaskCount: number;
|
|
301
|
+
readonly rejectedInstanceCount: number;
|
|
302
|
+
readonly totalInstanceCount: number;
|
|
303
|
+
readonly unreadNotificationCount: number;
|
|
304
|
+
}
|
|
305
|
+
export declare function listApprovalInstances(): Promise<readonly ApprovalInstanceRecord[]>;
|
|
306
|
+
export declare function listApprovalInstancesPage({ page, pageSize, searchText, state, templateId, view, }: ApprovalInstancesPageInput): Promise<ApprovalInstancesPageResult>;
|
|
307
|
+
export declare function readLaunchContext(templateId: string): Promise<LaunchContext>;
|
|
308
|
+
export declare function listLaunchableTemplates(): Promise<readonly LaunchableTemplateRecord[]>;
|
|
309
|
+
export declare function readApprovalInstance(instanceId: string): Promise<{
|
|
310
|
+
readonly activityLogs: readonly ActivityLogRecord[];
|
|
311
|
+
readonly instance: ApprovalInstanceRecord;
|
|
312
|
+
readonly tasks: readonly TaskRecord[];
|
|
313
|
+
readonly workflowTokens: readonly WorkflowTokenRecord[];
|
|
314
|
+
}>;
|
|
315
|
+
export declare function listInboxTasks(assigneeMemberId: string): Promise<readonly TaskRecord[]>;
|
|
316
|
+
export declare function listApprovalHistoryTasks(assigneeMemberId: string): Promise<readonly TaskRecord[]>;
|
|
317
|
+
export declare function readWorkflowDashboardSummary({ currentMemberId, from, to, }: {
|
|
318
|
+
readonly currentMemberId: string;
|
|
319
|
+
readonly from: string | null;
|
|
320
|
+
readonly to: string | null;
|
|
321
|
+
}): Promise<WorkflowDashboardSummaryRecord>;
|
|
322
|
+
export declare function listTaskDecisions(taskId: string): Promise<readonly TaskDecisionRecord[]>;
|
|
323
|
+
export declare function listAttachments(instanceId: string): Promise<readonly AttachmentRecord[]>;
|
|
324
|
+
export declare function uploadAttachment({ file, formFieldPath, }: {
|
|
325
|
+
readonly file: File;
|
|
326
|
+
readonly formFieldPath: string;
|
|
327
|
+
}): Promise<AttachmentRecord>;
|
|
328
|
+
export declare function readAttachmentDownloadUrl({ id, }: {
|
|
329
|
+
readonly id: string;
|
|
330
|
+
}): Promise<string>;
|
|
331
|
+
export declare function readAttachmentPreviewUrl({ id, }: {
|
|
332
|
+
readonly id: string;
|
|
333
|
+
}): Promise<string>;
|
|
334
|
+
export declare function readInstanceSignatures(instanceId: string): Promise<{
|
|
335
|
+
readonly signatures: readonly SignatureRecord[];
|
|
336
|
+
readonly verification: SignatureVerificationRecord;
|
|
337
|
+
}>;
|
|
338
|
+
export declare function resolveMemberProfiles(memberIds: readonly string[]): Promise<readonly MemberProfileRecord[]>;
|
|
339
|
+
export declare function searchMembers(searchText: string): Promise<readonly MemberProfileRecord[]>;
|
|
340
|
+
export declare function listMemberDirectoryPage({ page, pageSize, searchText, }: {
|
|
341
|
+
readonly page: number;
|
|
342
|
+
readonly pageSize: number;
|
|
343
|
+
readonly searchText?: string;
|
|
344
|
+
}): Promise<MemberDirectoryPage>;
|
|
345
|
+
export declare function listDelegationRules({ includeInactive, principalMemberId, }?: {
|
|
346
|
+
readonly includeInactive?: boolean;
|
|
347
|
+
readonly principalMemberId?: string | null;
|
|
348
|
+
}): Promise<readonly DelegationRuleRecord[]>;
|
|
349
|
+
export declare function listDelegationRulesPage({ agentMemberId, includeInactive, page, pageSize, principalMemberId, scopeType, status, }?: {
|
|
350
|
+
readonly agentMemberId?: string | null;
|
|
351
|
+
readonly includeInactive?: boolean;
|
|
352
|
+
readonly page?: number;
|
|
353
|
+
readonly pageSize?: number;
|
|
354
|
+
readonly principalMemberId?: string | null;
|
|
355
|
+
readonly scopeType?: DelegationScopeType | null;
|
|
356
|
+
readonly status?: DelegationRuleStatus | null;
|
|
357
|
+
}): Promise<{
|
|
358
|
+
readonly rules: readonly DelegationRuleRecord[];
|
|
359
|
+
readonly totalCount: number;
|
|
360
|
+
}>;
|
|
361
|
+
export declare function createDelegationRule(input: {
|
|
362
|
+
readonly agentMemberId: string;
|
|
363
|
+
readonly createdByMemberId: string | null;
|
|
364
|
+
readonly endAt: string | null;
|
|
365
|
+
readonly principalMemberId: string;
|
|
366
|
+
readonly priority: number;
|
|
367
|
+
readonly requiresConfirmation: boolean;
|
|
368
|
+
readonly scopeConditionCel: string | null;
|
|
369
|
+
readonly scopeTemplateIds: readonly string[];
|
|
370
|
+
readonly scopeType: DelegationScopeType;
|
|
371
|
+
readonly startAt: string | null;
|
|
372
|
+
}): Promise<DelegationRuleRecord>;
|
|
373
|
+
export declare function revokeDelegationRule({ id, revokedByMemberId, }: {
|
|
374
|
+
readonly id: string;
|
|
375
|
+
readonly revokedByMemberId: string | null;
|
|
376
|
+
}): Promise<DelegationRuleRecord>;
|
|
377
|
+
export declare function listNotifications({ includeRead, page, pageSize, recipientMemberId, }: {
|
|
378
|
+
readonly includeRead?: boolean;
|
|
379
|
+
readonly page?: number;
|
|
380
|
+
readonly pageSize?: number;
|
|
381
|
+
readonly recipientMemberId: string;
|
|
382
|
+
}): Promise<{
|
|
383
|
+
readonly notifications: readonly NotificationRecord[];
|
|
384
|
+
readonly totalCount: number;
|
|
385
|
+
readonly unreadCount: number;
|
|
386
|
+
}>;
|
|
387
|
+
export declare function readUnreadNotificationCount(recipientMemberId: string): Promise<number>;
|
|
388
|
+
export declare function markNotificationRead({ id, readerMemberId, }: {
|
|
389
|
+
readonly id: string;
|
|
390
|
+
readonly readerMemberId: string;
|
|
391
|
+
}): Promise<Pick<NotificationRecord, 'id' | 'readAt' | 'status'>>;
|
|
392
|
+
export declare function markAllNotificationsRead({ recipientMemberId, }: {
|
|
393
|
+
readonly recipientMemberId: string;
|
|
394
|
+
}): Promise<number>;
|
|
395
|
+
export declare function readNotificationPreference(memberId: string): Promise<NotificationPreferenceRecord>;
|
|
396
|
+
export declare function updateNotificationPreference(input: {
|
|
397
|
+
readonly emailDigestMode: NotificationDigestMode;
|
|
398
|
+
readonly emailEnabled: boolean;
|
|
399
|
+
readonly inAppEnabled: boolean;
|
|
400
|
+
readonly memberId: string;
|
|
401
|
+
readonly quietHoursEnd: string | null;
|
|
402
|
+
readonly quietHoursStart: string | null;
|
|
403
|
+
}): Promise<NotificationPreferenceRecord>;
|
|
404
|
+
export declare function submitApprovalInstance({ formData, initiatorMemberId, templateId, title, }: {
|
|
405
|
+
readonly formData: Readonly<Record<string, unknown>>;
|
|
406
|
+
readonly initiatorMemberId: string;
|
|
407
|
+
readonly templateId: string;
|
|
408
|
+
readonly title: string | null;
|
|
409
|
+
}): Promise<string>;
|
|
410
|
+
export declare function decideTask({ action, comment, decidedByMemberId, returnToNodeId, taskId, transferToMemberId, }: {
|
|
411
|
+
readonly action: TaskDecisionAction;
|
|
412
|
+
readonly comment: string | null;
|
|
413
|
+
readonly decidedByMemberId: string;
|
|
414
|
+
readonly returnToNodeId?: string | null;
|
|
415
|
+
readonly taskId: string;
|
|
416
|
+
readonly transferToMemberId?: string | null;
|
|
417
|
+
}): Promise<TaskDecisionRecord>;
|
|
418
|
+
export declare function cancelApprovalInstance({ cancelledByMemberId, comment, instanceId, }: {
|
|
419
|
+
readonly cancelledByMemberId: string;
|
|
420
|
+
readonly comment: string | null;
|
|
421
|
+
readonly instanceId: string;
|
|
422
|
+
}): Promise<void>;
|
|
423
|
+
export declare function resubmitApprovalInstance({ formData, initiatorMemberId, instanceId, title, }: {
|
|
424
|
+
readonly formData: Readonly<Record<string, unknown>>;
|
|
425
|
+
readonly initiatorMemberId: string;
|
|
426
|
+
readonly instanceId: string;
|
|
427
|
+
readonly title: string | null;
|
|
428
|
+
}): Promise<void>;
|
|
429
|
+
/**
|
|
430
|
+
* Ad-hoc countersign (臨時會簽): asks the given target to co-sign the NEXT
|
|
431
|
+
* stage of this instance. When the next user task is created, a parallel
|
|
432
|
+
* ad-hoc task is spawned for the target, and the flow only advances past
|
|
433
|
+
* that stage once BOTH the original task and every countersign task are
|
|
434
|
+
* approved. A countersigner's rejection rejects the whole instance.
|
|
435
|
+
*
|
|
436
|
+
* Only the current task's assignee/candidate may call this, and only on
|
|
437
|
+
* nodes whose template sets `allowAddSigner: true`. Returns the recorded
|
|
438
|
+
* directive (`PENDING` until the next user task consumes it; withdrawable
|
|
439
|
+
* via {@link cancelAdhocDirective} while pending). Never alters the
|
|
440
|
+
* workflow template.
|
|
441
|
+
*/
|
|
442
|
+
export declare function requestAdhocCountersign({ comment, target, taskId, }: {
|
|
443
|
+
readonly comment?: string | null;
|
|
444
|
+
readonly target: AdhocTargetOptions;
|
|
445
|
+
readonly taskId: string;
|
|
446
|
+
}): Promise<AdhocDirectiveRecord>;
|
|
447
|
+
/**
|
|
448
|
+
* Ad-hoc pre-approval (臨時加簽): immediately spawns a blocking ad-hoc task
|
|
449
|
+
* for the given target on the CURRENT stage. Even after the original
|
|
450
|
+
* approver approves, the flow stays on this stage until the pre-approver
|
|
451
|
+
* also approves. `onReject` decides what happens when the pre-approver
|
|
452
|
+
* rejects: `REJECT_INSTANCE` rejects the whole instance;
|
|
453
|
+
* `RETURN_TO_ORIGIN` hands the decision back to the original approver
|
|
454
|
+
* (re-opening their task if they had already approved).
|
|
455
|
+
*
|
|
456
|
+
* Only the current task's assignee/candidate may call this, and only on
|
|
457
|
+
* nodes whose template sets `allowAddSigner: true`. Returns the spawned
|
|
458
|
+
* ad-hoc task. Never alters the workflow template.
|
|
459
|
+
*/
|
|
460
|
+
export declare function requestAdhocPreApproval({ comment, onReject, target, taskId, }: {
|
|
461
|
+
readonly comment?: string | null;
|
|
462
|
+
readonly onReject: AdhocPreApprovalRejectBehavior;
|
|
463
|
+
readonly target: AdhocTargetOptions;
|
|
464
|
+
readonly taskId: string;
|
|
465
|
+
}): Promise<TaskRecord>;
|
|
466
|
+
/**
|
|
467
|
+
* Ad-hoc stage notification (臨時階段通知): notifies the target once the
|
|
468
|
+
* CURRENT stage ends — regardless of outcome (approved, rejected, or
|
|
469
|
+
* returned). Targets may be members, a position, an org unit, or a webhook
|
|
470
|
+
* URL. `channels` defaults to in-app notification.
|
|
471
|
+
*
|
|
472
|
+
* Available to the current task's assignee/candidate on any user-task node
|
|
473
|
+
* (no `allowAddSigner` requirement). Returns the recorded directive
|
|
474
|
+
* (withdrawable via {@link cancelAdhocDirective} while pending). Never
|
|
475
|
+
* alters the workflow template.
|
|
476
|
+
*/
|
|
477
|
+
export declare function configureAdhocStageNotification({ channels, target, taskId, }: {
|
|
478
|
+
readonly channels?: readonly NotificationChannel[] | null;
|
|
479
|
+
readonly target: AdhocTargetOptions;
|
|
480
|
+
readonly taskId: string;
|
|
481
|
+
}): Promise<AdhocDirectiveRecord>;
|
|
482
|
+
/**
|
|
483
|
+
* Ad-hoc completion notification (臨時完成通知): notifies the target once
|
|
484
|
+
* the WHOLE instance reaches a terminal state (`APPROVED`, `REJECTED`, or
|
|
485
|
+
* `CANCELLED`). Targets may be members, a position, an org unit, or a
|
|
486
|
+
* webhook URL. `channels` defaults to in-app notification.
|
|
487
|
+
*
|
|
488
|
+
* Available to the current task's assignee/candidate on any user-task node
|
|
489
|
+
* (no `allowAddSigner` requirement). Returns the recorded directive
|
|
490
|
+
* (withdrawable via {@link cancelAdhocDirective} while pending). Never
|
|
491
|
+
* alters the workflow template.
|
|
492
|
+
*/
|
|
493
|
+
export declare function configureAdhocCompletionNotification({ channels, target, taskId, }: {
|
|
494
|
+
readonly channels?: readonly NotificationChannel[] | null;
|
|
495
|
+
readonly target: AdhocTargetOptions;
|
|
496
|
+
readonly taskId: string;
|
|
497
|
+
}): Promise<AdhocDirectiveRecord>;
|
|
498
|
+
/**
|
|
499
|
+
* Withdraws a still-`PENDING` ad-hoc directive (countersign / stage-notify /
|
|
500
|
+
* completion-notify) before it takes effect. Only the directive's creator
|
|
501
|
+
* may withdraw it; pre-approval directives are consumed immediately on
|
|
502
|
+
* creation and therefore cannot be withdrawn.
|
|
503
|
+
*/
|
|
504
|
+
export declare function cancelAdhocDirective(directiveId: string): Promise<AdhocDirectiveRecord>;
|
|
505
|
+
/**
|
|
506
|
+
* Lists every ad-hoc directive recorded on one approval instance, ordered by
|
|
507
|
+
* creation time. Use the `status` field to find directives that are still
|
|
508
|
+
* pending (withdrawable) versus already consumed or cancelled.
|
|
509
|
+
*/
|
|
510
|
+
export declare function listAdhocDirectives(instanceId: string): Promise<readonly AdhocDirectiveRecord[]>;
|
|
511
|
+
export declare function readApprovalInstanceCaseTitle(instance: ApprovalInstanceRecord): string;
|
|
512
|
+
export declare function readFormDataCaseTitle({ fallbackTitle, formData, schema, uiSchema, }: {
|
|
513
|
+
readonly fallbackTitle: string;
|
|
514
|
+
readonly formData: WorkflowFormData;
|
|
515
|
+
readonly schema: FormDefinitionSchema | null;
|
|
516
|
+
readonly uiSchema: FormUiSchema | null;
|
|
517
|
+
}): string;
|