openxiangda-contracts 2.0.0-alpha.12
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/README.md +8 -0
- package/dist/browser.d.ts +5 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +5 -0
- package/dist/browser.js.map +1 -0
- package/dist/canonical.d.ts +3 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +44 -0
- package/dist/canonical.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas.d.ts +6935 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +2216 -0
- package/dist/schemas.js.map +1 -0
- package/dist/types.d.ts +1153 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +53 -0
- package/dist/types.js.map +1 -0
- package/dist/validation.d.ts +13 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +263 -0
- package/dist/validation.js.map +1 -0
- package/package.json +35 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,1153 @@
|
|
|
1
|
+
export declare const OPENXIANGDA_CONTRACT_VERSION: "2.0.0-alpha.1";
|
|
2
|
+
export declare const SCHEMA_VERSIONS: {
|
|
3
|
+
readonly workspaceContext: "openxiangda.workspace-context/v2";
|
|
4
|
+
readonly application: "openxiangda.application/v2";
|
|
5
|
+
readonly applicationSecret: "openxiangda.application-secret/v2";
|
|
6
|
+
readonly diagnostic: "openxiangda.diagnostic/v2";
|
|
7
|
+
readonly principal: "openxiangda.principal/v2";
|
|
8
|
+
readonly roleAssignment: "openxiangda.role-assignment/v2";
|
|
9
|
+
readonly relationshipGrant: "openxiangda.relationship-grant/v2";
|
|
10
|
+
readonly roleSession: "openxiangda.role-session/v2";
|
|
11
|
+
readonly authorizationDecision: "openxiangda.authorization-decision/v2";
|
|
12
|
+
readonly authorizationBatchRequest: "openxiangda.authorization-batch-request/v2";
|
|
13
|
+
readonly authorizationBatchResult: "openxiangda.authorization-batch-result/v2";
|
|
14
|
+
readonly directoryResolveRequest: "openxiangda.directory-resolve-request/v2";
|
|
15
|
+
readonly directorySearchResult: "openxiangda.directory-search-result/v2";
|
|
16
|
+
readonly dataRef: "openxiangda.data-ref/v2";
|
|
17
|
+
readonly dataResource: "openxiangda.data-resource/v2";
|
|
18
|
+
readonly dataQuery: "openxiangda.data-query/v2";
|
|
19
|
+
readonly dataPage: "openxiangda.data-page/v2";
|
|
20
|
+
readonly dataRecord: "openxiangda.data-record/v2";
|
|
21
|
+
readonly dataAggregateQuery: "openxiangda.data-aggregate-query/v2";
|
|
22
|
+
readonly dataAggregatePage: "openxiangda.data-aggregate-page/v2";
|
|
23
|
+
readonly dataAuditPage: "openxiangda.data-audit-page/v2";
|
|
24
|
+
readonly dataFileRef: "openxiangda.data-file-ref/v2";
|
|
25
|
+
readonly dataFileUploadPlan: "openxiangda.data-file-upload-plan/v2";
|
|
26
|
+
readonly dataTransactionRequest: "openxiangda.data-transaction-request/v2";
|
|
27
|
+
readonly dataTransactionResult: "openxiangda.data-transaction-result/v2";
|
|
28
|
+
readonly cloudEvent: "openxiangda.cloud-event/v1";
|
|
29
|
+
readonly eventSubscription: "openxiangda.event-subscription/v2";
|
|
30
|
+
readonly eventDelivery: "openxiangda.event-delivery/v2";
|
|
31
|
+
readonly eventReceiptCommand: "openxiangda.event-receipt-command/v2";
|
|
32
|
+
readonly eventReceiptResult: "openxiangda.event-receipt-result/v2";
|
|
33
|
+
readonly timerSubscription: "openxiangda.timer-subscription/v2";
|
|
34
|
+
readonly workflowDefinition: "openxiangda.workflow-definition/v2";
|
|
35
|
+
readonly workflowBinding: "openxiangda.workflow-binding/v2";
|
|
36
|
+
readonly workflowPreparation: "openxiangda.workflow-preparation/v2";
|
|
37
|
+
readonly workflowInstance: "openxiangda.workflow-instance/v2";
|
|
38
|
+
readonly workflowTask: "openxiangda.workflow-task/v2";
|
|
39
|
+
readonly workflowSurface: "openxiangda.workflow-surface/v2";
|
|
40
|
+
readonly workflowDelegation: "openxiangda.workflow-delegation/v2";
|
|
41
|
+
readonly workflowAssigneeProvider: "openxiangda.workflow-assignee-provider/v2";
|
|
42
|
+
readonly workflowAssigneeRequest: "openxiangda.workflow-assignee-request/v2";
|
|
43
|
+
readonly workflowAssigneeResponse: "openxiangda.workflow-assignee-response/v2";
|
|
44
|
+
readonly workflowKernelDescriptor: "openxiangda.workflow-kernel-descriptor/v2";
|
|
45
|
+
readonly workflowKernelWorkItem: "openxiangda.workflow-kernel-work-item/v2";
|
|
46
|
+
readonly workflowKernelWorkCenter: "openxiangda.workflow-kernel-work-center/v2";
|
|
47
|
+
readonly appPackage: "openxiangda.app-package/v2";
|
|
48
|
+
readonly appVersion: "openxiangda.app-version/v2";
|
|
49
|
+
readonly environmentHead: "openxiangda.environment-head/v2";
|
|
50
|
+
readonly deploymentRun: "openxiangda.deployment-run/v2";
|
|
51
|
+
readonly platformCapabilities: "openxiangda.platform-capabilities/v2";
|
|
52
|
+
};
|
|
53
|
+
export type SchemaVersion = (typeof SCHEMA_VERSIONS)[keyof typeof SCHEMA_VERSIONS];
|
|
54
|
+
export type Sha256Digest = string;
|
|
55
|
+
export type IsoDateTime = string;
|
|
56
|
+
export type DiagnosticSeverity = "info" | "warning" | "error";
|
|
57
|
+
export interface Diagnostic {
|
|
58
|
+
schemaVersion: typeof SCHEMA_VERSIONS.diagnostic;
|
|
59
|
+
code: string;
|
|
60
|
+
severity: DiagnosticSeverity;
|
|
61
|
+
message: string;
|
|
62
|
+
path?: string;
|
|
63
|
+
source?: string;
|
|
64
|
+
retryable: boolean;
|
|
65
|
+
remediation?: string;
|
|
66
|
+
details?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
export interface WorkspaceIdentity {
|
|
69
|
+
appCode: string;
|
|
70
|
+
name?: string;
|
|
71
|
+
root: string;
|
|
72
|
+
repository?: string;
|
|
73
|
+
revision?: string;
|
|
74
|
+
dirty?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface WorkspaceContext {
|
|
77
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workspaceContext;
|
|
78
|
+
workspace: WorkspaceIdentity;
|
|
79
|
+
roots: {
|
|
80
|
+
frontend: string;
|
|
81
|
+
backend: string;
|
|
82
|
+
platform: string;
|
|
83
|
+
};
|
|
84
|
+
toolchain: {
|
|
85
|
+
version: string;
|
|
86
|
+
contractVersion: typeof OPENXIANGDA_CONTRACT_VERSION;
|
|
87
|
+
nodeVersion: string;
|
|
88
|
+
packageManager: string;
|
|
89
|
+
};
|
|
90
|
+
environments: Array<{
|
|
91
|
+
id?: string;
|
|
92
|
+
name: string;
|
|
93
|
+
kind: "development" | "preproduction" | "production";
|
|
94
|
+
}>;
|
|
95
|
+
changedDomains: Array<"frontend" | "backend" | "data" | "authz" | "events" | "workflow" | "config">;
|
|
96
|
+
}
|
|
97
|
+
export interface ProvisionedApplication {
|
|
98
|
+
schemaVersion: typeof SCHEMA_VERSIONS.application;
|
|
99
|
+
created: boolean;
|
|
100
|
+
application: {
|
|
101
|
+
id: string;
|
|
102
|
+
appCode: string;
|
|
103
|
+
name: string;
|
|
104
|
+
description?: string | null;
|
|
105
|
+
runtimeMode: "react-spa";
|
|
106
|
+
createdAt?: IsoDateTime | null;
|
|
107
|
+
updatedAt?: IsoDateTime | null;
|
|
108
|
+
};
|
|
109
|
+
bootstrapAdminRole: {
|
|
110
|
+
code: string;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export type PrincipalType = "user" | "service" | "public";
|
|
114
|
+
export interface Principal {
|
|
115
|
+
schemaVersion: typeof SCHEMA_VERSIONS.principal;
|
|
116
|
+
tenantId: string;
|
|
117
|
+
appCode: string;
|
|
118
|
+
environmentId: string;
|
|
119
|
+
principalType: PrincipalType;
|
|
120
|
+
subjectId: string;
|
|
121
|
+
userId?: string;
|
|
122
|
+
loginSessionId?: string;
|
|
123
|
+
roleSessionId?: string;
|
|
124
|
+
activeRoleAssignmentId?: string;
|
|
125
|
+
activeRoleCode?: string;
|
|
126
|
+
authzVersion: number;
|
|
127
|
+
isAppSuperAdmin: boolean;
|
|
128
|
+
}
|
|
129
|
+
export interface OAuthApplicationPrincipal {
|
|
130
|
+
principalType: "application";
|
|
131
|
+
clientRecordId: string;
|
|
132
|
+
clientId: string;
|
|
133
|
+
credentialVersion: number;
|
|
134
|
+
tenantId: string;
|
|
135
|
+
appCode: string;
|
|
136
|
+
environmentKey: string;
|
|
137
|
+
scopes: string[];
|
|
138
|
+
rateLimitPerMinute: number;
|
|
139
|
+
tokenId: string;
|
|
140
|
+
issuedAt?: number;
|
|
141
|
+
expiresAt?: number;
|
|
142
|
+
}
|
|
143
|
+
export interface OAuthClient {
|
|
144
|
+
id: string;
|
|
145
|
+
appCode: string;
|
|
146
|
+
environmentKey: string;
|
|
147
|
+
name: string;
|
|
148
|
+
clientId: string;
|
|
149
|
+
clientKind: "external" | "runtime";
|
|
150
|
+
platformManaged: boolean;
|
|
151
|
+
clientSecretHint: string;
|
|
152
|
+
previousClientSecretHint?: string | null;
|
|
153
|
+
previousSecretValidUntil?: IsoDateTime | null;
|
|
154
|
+
pendingRotation?: {
|
|
155
|
+
credentialVersion: number;
|
|
156
|
+
requestedAt: IsoDateTime | null;
|
|
157
|
+
gracePeriodSeconds: number;
|
|
158
|
+
} | null;
|
|
159
|
+
scopes: string[];
|
|
160
|
+
status: "active" | "revoked";
|
|
161
|
+
credentialVersion: number;
|
|
162
|
+
rateLimitPerMinute: number;
|
|
163
|
+
lastUsedAt?: IsoDateTime | null;
|
|
164
|
+
lastRotatedAt?: IsoDateTime | null;
|
|
165
|
+
createdAt: IsoDateTime;
|
|
166
|
+
updatedAt: IsoDateTime;
|
|
167
|
+
}
|
|
168
|
+
export interface RuntimeOAuthCredentialStatus {
|
|
169
|
+
configured: boolean;
|
|
170
|
+
requiresRedeploy: boolean;
|
|
171
|
+
client: OAuthClient | null;
|
|
172
|
+
idempotentReplay?: boolean;
|
|
173
|
+
}
|
|
174
|
+
export interface OAuthAuditEvent {
|
|
175
|
+
id: string;
|
|
176
|
+
appCode: string | null;
|
|
177
|
+
environmentKey: string | null;
|
|
178
|
+
clientId: string | null;
|
|
179
|
+
eventType: string;
|
|
180
|
+
outcome: "allowed" | "denied";
|
|
181
|
+
actorType: "user" | "application" | "anonymous";
|
|
182
|
+
actorId: string | null;
|
|
183
|
+
tokenId: string | null;
|
|
184
|
+
requestId: string | null;
|
|
185
|
+
ipAddress: string | null;
|
|
186
|
+
reasonCode: string | null;
|
|
187
|
+
details: Record<string, unknown>;
|
|
188
|
+
createdAt: IsoDateTime;
|
|
189
|
+
}
|
|
190
|
+
export interface ApplicationSecret {
|
|
191
|
+
schemaVersion: typeof SCHEMA_VERSIONS.applicationSecret;
|
|
192
|
+
id: string;
|
|
193
|
+
appCode: string;
|
|
194
|
+
environmentKey: string;
|
|
195
|
+
name: string;
|
|
196
|
+
description: string | null;
|
|
197
|
+
status: "active" | "disabled" | "deleted";
|
|
198
|
+
revision: number;
|
|
199
|
+
hasValue: boolean;
|
|
200
|
+
expiresAt: IsoDateTime | null;
|
|
201
|
+
createdAt: IsoDateTime;
|
|
202
|
+
updatedAt: IsoDateTime;
|
|
203
|
+
idempotentReplay?: boolean;
|
|
204
|
+
references?: {
|
|
205
|
+
activeConfiguration: {
|
|
206
|
+
appVersionId: string;
|
|
207
|
+
version: string;
|
|
208
|
+
configDigest: string;
|
|
209
|
+
} | null;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
export interface ApplicationSecretAuditEvent {
|
|
213
|
+
schemaVersion: typeof SCHEMA_VERSIONS.applicationSecret;
|
|
214
|
+
id: string;
|
|
215
|
+
appCode: string;
|
|
216
|
+
environmentKey: string;
|
|
217
|
+
name: string;
|
|
218
|
+
eventType: string;
|
|
219
|
+
outcome: "allowed" | "denied";
|
|
220
|
+
actorUserId: string | null;
|
|
221
|
+
version: number | null;
|
|
222
|
+
revision: number | null;
|
|
223
|
+
reason: string | null;
|
|
224
|
+
metadata: Record<string, unknown>;
|
|
225
|
+
createdAt: IsoDateTime;
|
|
226
|
+
}
|
|
227
|
+
export interface RoleSession {
|
|
228
|
+
schemaVersion: typeof SCHEMA_VERSIONS.roleSession;
|
|
229
|
+
id: string;
|
|
230
|
+
loginSessionId: string;
|
|
231
|
+
tenantId: string;
|
|
232
|
+
appCode: string;
|
|
233
|
+
userId: string;
|
|
234
|
+
activeRoleAssignmentId: string;
|
|
235
|
+
activeRoleCode: string;
|
|
236
|
+
authzVersion: number;
|
|
237
|
+
issuedAt: IsoDateTime;
|
|
238
|
+
expiresAt: IsoDateTime;
|
|
239
|
+
lastUsedAt: IsoDateTime;
|
|
240
|
+
}
|
|
241
|
+
export interface RoleAssignmentScopeGrant {
|
|
242
|
+
dimensionCode: string;
|
|
243
|
+
values: string[];
|
|
244
|
+
operations: string[];
|
|
245
|
+
}
|
|
246
|
+
export interface ApplicationRole {
|
|
247
|
+
id: string;
|
|
248
|
+
appCode: string;
|
|
249
|
+
code: string;
|
|
250
|
+
name: string;
|
|
251
|
+
description?: string | null;
|
|
252
|
+
isAppSuperAdmin: boolean;
|
|
253
|
+
}
|
|
254
|
+
export interface RoleAssignment {
|
|
255
|
+
schemaVersion: typeof SCHEMA_VERSIONS.roleAssignment;
|
|
256
|
+
id: string;
|
|
257
|
+
tenantId: string;
|
|
258
|
+
appCode: string;
|
|
259
|
+
userId: string;
|
|
260
|
+
role: {
|
|
261
|
+
id: string;
|
|
262
|
+
code: string;
|
|
263
|
+
name: string;
|
|
264
|
+
isAppSuperAdmin: boolean;
|
|
265
|
+
};
|
|
266
|
+
status: "active" | "revoked" | "expired";
|
|
267
|
+
revision: number;
|
|
268
|
+
scopeGrants: RoleAssignmentScopeGrant[];
|
|
269
|
+
validFrom?: IsoDateTime | null;
|
|
270
|
+
validTo?: IsoDateTime | null;
|
|
271
|
+
createdAt: IsoDateTime;
|
|
272
|
+
updatedAt: IsoDateTime;
|
|
273
|
+
}
|
|
274
|
+
export type RelationshipGrantSubjectType = "user" | "role_assignment";
|
|
275
|
+
export type RelationshipGrantStatus = "active" | "revoked" | "expired";
|
|
276
|
+
export interface RelationshipGrant {
|
|
277
|
+
schemaVersion: typeof SCHEMA_VERSIONS.relationshipGrant;
|
|
278
|
+
id: string;
|
|
279
|
+
tenantId: string;
|
|
280
|
+
appCode: string;
|
|
281
|
+
relationCode: string;
|
|
282
|
+
subjectType: RelationshipGrantSubjectType;
|
|
283
|
+
subjectKey: string;
|
|
284
|
+
resourceCode: string;
|
|
285
|
+
resourceId: string;
|
|
286
|
+
operations: string[];
|
|
287
|
+
sourceCode: string;
|
|
288
|
+
status: RelationshipGrantStatus;
|
|
289
|
+
revision: number;
|
|
290
|
+
validFrom?: IsoDateTime | null;
|
|
291
|
+
validTo?: IsoDateTime | null;
|
|
292
|
+
createdAt: IsoDateTime;
|
|
293
|
+
updatedAt: IsoDateTime;
|
|
294
|
+
}
|
|
295
|
+
export interface AuthorizationDecisionLayer {
|
|
296
|
+
layer: "app_super_admin" | "rbac" | "data_policy" | "field_policy";
|
|
297
|
+
allowed: boolean;
|
|
298
|
+
reason?: string;
|
|
299
|
+
detail?: Record<string, unknown>;
|
|
300
|
+
[key: string]: unknown;
|
|
301
|
+
}
|
|
302
|
+
export interface AuthorizationDecision {
|
|
303
|
+
schemaVersion: typeof SCHEMA_VERSIONS.authorizationDecision;
|
|
304
|
+
explainId: string;
|
|
305
|
+
allowed: boolean;
|
|
306
|
+
principal: Principal;
|
|
307
|
+
roleSession: RoleSession;
|
|
308
|
+
decisions: AuthorizationDecisionLayer[];
|
|
309
|
+
}
|
|
310
|
+
export interface AuthorizationExplainRequest {
|
|
311
|
+
key: string;
|
|
312
|
+
capability: string;
|
|
313
|
+
dataPolicyCode?: string;
|
|
314
|
+
operation?: string;
|
|
315
|
+
data?: Record<string, unknown>;
|
|
316
|
+
}
|
|
317
|
+
export interface AuthorizationBatchRequest {
|
|
318
|
+
schemaVersion: typeof SCHEMA_VERSIONS.authorizationBatchRequest;
|
|
319
|
+
requests: AuthorizationExplainRequest[];
|
|
320
|
+
}
|
|
321
|
+
export interface AuthorizationBatchResult {
|
|
322
|
+
schemaVersion: typeof SCHEMA_VERSIONS.authorizationBatchResult;
|
|
323
|
+
principal: Principal;
|
|
324
|
+
roleSession: RoleSession;
|
|
325
|
+
items: Array<{
|
|
326
|
+
key: string;
|
|
327
|
+
decision: AuthorizationDecision;
|
|
328
|
+
}>;
|
|
329
|
+
}
|
|
330
|
+
export type DirectoryEntryKind = "department" | "user";
|
|
331
|
+
export interface DirectoryEntry {
|
|
332
|
+
kind: DirectoryEntryKind;
|
|
333
|
+
id: string;
|
|
334
|
+
label: string;
|
|
335
|
+
description?: string;
|
|
336
|
+
path?: Array<{
|
|
337
|
+
id: string;
|
|
338
|
+
label: string;
|
|
339
|
+
}>;
|
|
340
|
+
}
|
|
341
|
+
export interface DirectoryResolveRequest {
|
|
342
|
+
schemaVersion: typeof SCHEMA_VERSIONS.directoryResolveRequest;
|
|
343
|
+
kind: DirectoryEntryKind;
|
|
344
|
+
ids: string[];
|
|
345
|
+
}
|
|
346
|
+
export interface DirectorySearchResult {
|
|
347
|
+
schemaVersion: typeof SCHEMA_VERSIONS.directorySearchResult;
|
|
348
|
+
kind: DirectoryEntryKind;
|
|
349
|
+
items: DirectoryEntry[];
|
|
350
|
+
total: number;
|
|
351
|
+
}
|
|
352
|
+
export interface DataRef {
|
|
353
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataRef;
|
|
354
|
+
appCode: string;
|
|
355
|
+
resource: string;
|
|
356
|
+
recordId: string;
|
|
357
|
+
revision: number;
|
|
358
|
+
environmentId?: string;
|
|
359
|
+
}
|
|
360
|
+
export type DataFieldType = "string" | "text" | "integer" | "decimal" | "boolean" | "date" | "datetime" | "uuid" | "json" | "file";
|
|
361
|
+
export interface DataFieldDefinition {
|
|
362
|
+
code: string;
|
|
363
|
+
type: DataFieldType;
|
|
364
|
+
nullable?: boolean;
|
|
365
|
+
indexed?: boolean;
|
|
366
|
+
file?: {
|
|
367
|
+
multiple?: boolean;
|
|
368
|
+
maxCount?: number;
|
|
369
|
+
maxSizeMb?: number;
|
|
370
|
+
accept?: string[];
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
export interface DataFieldPolicy {
|
|
374
|
+
read?: string[];
|
|
375
|
+
write?: string[];
|
|
376
|
+
mask?: "omit" | "null";
|
|
377
|
+
}
|
|
378
|
+
export interface DataResource {
|
|
379
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataResource;
|
|
380
|
+
id?: string;
|
|
381
|
+
tenantId?: string;
|
|
382
|
+
appCode: string;
|
|
383
|
+
code: string;
|
|
384
|
+
name: string;
|
|
385
|
+
schema: {
|
|
386
|
+
fields: DataFieldDefinition[];
|
|
387
|
+
};
|
|
388
|
+
capabilities: {
|
|
389
|
+
read: string;
|
|
390
|
+
create: string;
|
|
391
|
+
update: string;
|
|
392
|
+
delete: string;
|
|
393
|
+
};
|
|
394
|
+
dataPolicyCode?: string | null;
|
|
395
|
+
fieldPolicies: Record<string, DataFieldPolicy>;
|
|
396
|
+
status?: "active" | "retired";
|
|
397
|
+
revision?: number;
|
|
398
|
+
createdAt?: IsoDateTime;
|
|
399
|
+
updatedAt?: IsoDateTime;
|
|
400
|
+
}
|
|
401
|
+
export type DataFilterOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "like" | "ilike" | "in" | "is" | "cs" | "cd" | "ov";
|
|
402
|
+
export interface DataQuery {
|
|
403
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataQuery;
|
|
404
|
+
select?: string[];
|
|
405
|
+
filters?: Array<{
|
|
406
|
+
field: string;
|
|
407
|
+
operator: DataFilterOperator;
|
|
408
|
+
value: unknown;
|
|
409
|
+
}>;
|
|
410
|
+
order?: Array<{
|
|
411
|
+
field: string;
|
|
412
|
+
direction?: "asc" | "desc";
|
|
413
|
+
nulls?: "first" | "last";
|
|
414
|
+
}>;
|
|
415
|
+
limit?: number;
|
|
416
|
+
offset?: number;
|
|
417
|
+
}
|
|
418
|
+
export interface DataPage<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
419
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataPage;
|
|
420
|
+
resourceCode: string;
|
|
421
|
+
items: T[];
|
|
422
|
+
total: number;
|
|
423
|
+
limit: number;
|
|
424
|
+
offset: number;
|
|
425
|
+
}
|
|
426
|
+
export interface DataRecord<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
427
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataRecord;
|
|
428
|
+
resourceCode: string;
|
|
429
|
+
data: T;
|
|
430
|
+
}
|
|
431
|
+
export type DataAggregateMeasureType = "count" | "countDistinct" | "sum" | "avg" | "min" | "max";
|
|
432
|
+
export interface DataAggregateQuery {
|
|
433
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataAggregateQuery;
|
|
434
|
+
dimensions?: Array<{
|
|
435
|
+
field: string;
|
|
436
|
+
as: string;
|
|
437
|
+
bucket?: "day" | "week" | "month" | "quarter" | "year";
|
|
438
|
+
}>;
|
|
439
|
+
measures: Array<{
|
|
440
|
+
type: DataAggregateMeasureType;
|
|
441
|
+
field?: string;
|
|
442
|
+
as: string;
|
|
443
|
+
}>;
|
|
444
|
+
filters?: DataQuery["filters"];
|
|
445
|
+
order?: Array<{
|
|
446
|
+
field: string;
|
|
447
|
+
direction?: "asc" | "desc";
|
|
448
|
+
nulls?: "first" | "last";
|
|
449
|
+
}>;
|
|
450
|
+
limit?: number;
|
|
451
|
+
offset?: number;
|
|
452
|
+
}
|
|
453
|
+
export interface DataAggregatePage<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
454
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataAggregatePage;
|
|
455
|
+
resourceCode: string;
|
|
456
|
+
items: T[];
|
|
457
|
+
total: number;
|
|
458
|
+
limit: number;
|
|
459
|
+
offset: number;
|
|
460
|
+
}
|
|
461
|
+
export interface DataAuditEntry {
|
|
462
|
+
id: string;
|
|
463
|
+
operation: "created" | "updated" | "deleted";
|
|
464
|
+
recordId: string;
|
|
465
|
+
revision: number;
|
|
466
|
+
actor: {
|
|
467
|
+
userId: string;
|
|
468
|
+
roleSessionId?: string | null;
|
|
469
|
+
principalType?: "user" | "application";
|
|
470
|
+
oauthClientId?: string | null;
|
|
471
|
+
};
|
|
472
|
+
correlation?: {
|
|
473
|
+
eventId: string;
|
|
474
|
+
requestId: string | null;
|
|
475
|
+
traceId: string | null;
|
|
476
|
+
environmentKey: string;
|
|
477
|
+
outboxStatus: string;
|
|
478
|
+
outboxAttempts: number;
|
|
479
|
+
outboxError: string | null;
|
|
480
|
+
outboxUpdatedAt: IsoDateTime | null;
|
|
481
|
+
};
|
|
482
|
+
changes?: Record<string, unknown>;
|
|
483
|
+
before?: Record<string, unknown>;
|
|
484
|
+
record?: Record<string, unknown>;
|
|
485
|
+
occurredAt: IsoDateTime;
|
|
486
|
+
}
|
|
487
|
+
export interface DataAuditPage {
|
|
488
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataAuditPage;
|
|
489
|
+
resourceCode: string;
|
|
490
|
+
recordId: string;
|
|
491
|
+
items: DataAuditEntry[];
|
|
492
|
+
total: number;
|
|
493
|
+
limit: number;
|
|
494
|
+
offset: number;
|
|
495
|
+
}
|
|
496
|
+
export interface DataFileRef {
|
|
497
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataFileRef;
|
|
498
|
+
id: string;
|
|
499
|
+
name: string;
|
|
500
|
+
size: number;
|
|
501
|
+
contentType: string;
|
|
502
|
+
}
|
|
503
|
+
export interface DataFileUploadPlan {
|
|
504
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataFileUploadPlan;
|
|
505
|
+
resourceCode: string;
|
|
506
|
+
fieldCode: string;
|
|
507
|
+
file: DataFileRef;
|
|
508
|
+
uploadMethod: "PUT";
|
|
509
|
+
uploadUrl: string;
|
|
510
|
+
headers: Record<string, string>;
|
|
511
|
+
expiresAt: IsoDateTime;
|
|
512
|
+
}
|
|
513
|
+
export type DataTransactionOperation = {
|
|
514
|
+
operation: "create";
|
|
515
|
+
resourceCode: string;
|
|
516
|
+
data: Record<string, unknown>;
|
|
517
|
+
} | {
|
|
518
|
+
operation: "update";
|
|
519
|
+
resourceCode: string;
|
|
520
|
+
id: string;
|
|
521
|
+
expectedRevision: number;
|
|
522
|
+
data: Record<string, unknown>;
|
|
523
|
+
} | {
|
|
524
|
+
operation: "delete";
|
|
525
|
+
resourceCode: string;
|
|
526
|
+
id: string;
|
|
527
|
+
expectedRevision: number;
|
|
528
|
+
};
|
|
529
|
+
export interface DataTransactionRequest {
|
|
530
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataTransactionRequest;
|
|
531
|
+
idempotencyKey: string;
|
|
532
|
+
operations: DataTransactionOperation[];
|
|
533
|
+
}
|
|
534
|
+
export interface DataTransactionResult {
|
|
535
|
+
schemaVersion: typeof SCHEMA_VERSIONS.dataTransactionResult;
|
|
536
|
+
idempotencyKey: string;
|
|
537
|
+
replayed: boolean;
|
|
538
|
+
items: Array<{
|
|
539
|
+
index: number;
|
|
540
|
+
resourceCode: string;
|
|
541
|
+
operation: "create" | "update" | "delete";
|
|
542
|
+
id: string;
|
|
543
|
+
revision: number;
|
|
544
|
+
}>;
|
|
545
|
+
}
|
|
546
|
+
export interface CloudEvent<TData extends Record<string, unknown> = Record<string, unknown>> {
|
|
547
|
+
specversion: "1.0";
|
|
548
|
+
id: string;
|
|
549
|
+
source: string;
|
|
550
|
+
type: string;
|
|
551
|
+
subject?: string;
|
|
552
|
+
time: IsoDateTime;
|
|
553
|
+
datacontenttype: "application/json";
|
|
554
|
+
dataschema?: string;
|
|
555
|
+
data: TData;
|
|
556
|
+
tenantid: string;
|
|
557
|
+
appcode: string;
|
|
558
|
+
environment: string;
|
|
559
|
+
traceid?: string;
|
|
560
|
+
schemaversion: string;
|
|
561
|
+
}
|
|
562
|
+
export interface EventSubscription {
|
|
563
|
+
schemaVersion: typeof SCHEMA_VERSIONS.eventSubscription;
|
|
564
|
+
id: string;
|
|
565
|
+
appCode: string;
|
|
566
|
+
code: string;
|
|
567
|
+
description: string | null;
|
|
568
|
+
eventTypes: string[];
|
|
569
|
+
subjectFilters: {
|
|
570
|
+
equals?: string;
|
|
571
|
+
prefix?: string;
|
|
572
|
+
suffix?: string;
|
|
573
|
+
contains?: string | string[];
|
|
574
|
+
};
|
|
575
|
+
environmentKey: string;
|
|
576
|
+
endpointPath: string;
|
|
577
|
+
delivery: {
|
|
578
|
+
timeoutMs: number;
|
|
579
|
+
maxAttempts: number;
|
|
580
|
+
initialBackoffMs: number;
|
|
581
|
+
maxBackoffMs: number;
|
|
582
|
+
};
|
|
583
|
+
status: "active" | "paused";
|
|
584
|
+
revision: number;
|
|
585
|
+
signingSecret?: string;
|
|
586
|
+
signingSecretVersion?: number;
|
|
587
|
+
pendingSigningSecretVersion?: number | null;
|
|
588
|
+
rotationPending?: boolean;
|
|
589
|
+
previousSigningSecretVersion?: number | null;
|
|
590
|
+
previousSigningSecretValidUntil?: IsoDateTime | null;
|
|
591
|
+
signingSecretReturnedOnce?: boolean;
|
|
592
|
+
createdAt: IsoDateTime;
|
|
593
|
+
updatedAt: IsoDateTime;
|
|
594
|
+
}
|
|
595
|
+
export interface EventDelivery {
|
|
596
|
+
schemaVersion: typeof SCHEMA_VERSIONS.eventDelivery;
|
|
597
|
+
id: string;
|
|
598
|
+
eventId: string;
|
|
599
|
+
eventType: string;
|
|
600
|
+
subject: string | null;
|
|
601
|
+
subscriptionId: string;
|
|
602
|
+
subscriptionCode: string;
|
|
603
|
+
status: "pending" | "delivering" | "retry_wait" | "succeeded" | "dead_lettered";
|
|
604
|
+
attempt: number;
|
|
605
|
+
nextAttemptAt: IsoDateTime | null;
|
|
606
|
+
deliveredAt: IsoDateTime | null;
|
|
607
|
+
responseStatus: number | null;
|
|
608
|
+
responseBodyPreview: string | null;
|
|
609
|
+
lastError: string | null;
|
|
610
|
+
replayOfDeliveryId: string | null;
|
|
611
|
+
correlation?: {
|
|
612
|
+
eventId: string;
|
|
613
|
+
requestId: string | null;
|
|
614
|
+
traceId: string | null;
|
|
615
|
+
environmentKey: string;
|
|
616
|
+
eventOccurredAt: IsoDateTime | null;
|
|
617
|
+
outboxStatus: string | null;
|
|
618
|
+
outboxAttempts: number;
|
|
619
|
+
outboxError: string | null;
|
|
620
|
+
};
|
|
621
|
+
createdAt: IsoDateTime;
|
|
622
|
+
updatedAt: IsoDateTime;
|
|
623
|
+
}
|
|
624
|
+
export interface EventReceiptCommand {
|
|
625
|
+
schemaVersion: typeof SCHEMA_VERSIONS.eventReceiptCommand;
|
|
626
|
+
action: "claim" | "complete" | "release";
|
|
627
|
+
tenantId: string;
|
|
628
|
+
appCode: string;
|
|
629
|
+
environmentKey: string;
|
|
630
|
+
subscriptionCode: string;
|
|
631
|
+
eventId: string;
|
|
632
|
+
deliveryId: string;
|
|
633
|
+
claimToken?: string;
|
|
634
|
+
}
|
|
635
|
+
export interface EventReceiptResult {
|
|
636
|
+
schemaVersion: typeof SCHEMA_VERSIONS.eventReceiptResult;
|
|
637
|
+
outcome: "claimed" | "duplicate" | "completed" | "released";
|
|
638
|
+
eventId: string;
|
|
639
|
+
deliveryId: string;
|
|
640
|
+
status: "processing" | "succeeded" | "released";
|
|
641
|
+
claimToken: string | null;
|
|
642
|
+
attempts: number;
|
|
643
|
+
leaseExpiresAt: IsoDateTime;
|
|
644
|
+
completedAt: IsoDateTime | null;
|
|
645
|
+
}
|
|
646
|
+
export interface TimerSubscription {
|
|
647
|
+
schemaVersion: typeof SCHEMA_VERSIONS.timerSubscription;
|
|
648
|
+
id: string;
|
|
649
|
+
appCode: string;
|
|
650
|
+
code: string;
|
|
651
|
+
eventType: string;
|
|
652
|
+
cronExpression: string;
|
|
653
|
+
timezone: string;
|
|
654
|
+
payload: Record<string, unknown>;
|
|
655
|
+
environmentKey: string;
|
|
656
|
+
status: "active" | "paused";
|
|
657
|
+
revision: number;
|
|
658
|
+
nextDueAt: IsoDateTime | null;
|
|
659
|
+
lastFiredAt: IsoDateTime | null;
|
|
660
|
+
createdAt: IsoDateTime;
|
|
661
|
+
updatedAt: IsoDateTime;
|
|
662
|
+
}
|
|
663
|
+
export type WorkflowApprovalMode = "single" | "any" | "all" | "sequence";
|
|
664
|
+
export type WorkflowFieldPolicy = "hidden" | "readonly" | "edit" | "edit_required";
|
|
665
|
+
export type WorkflowCommand = "approve" | "reject" | "return" | "transfer" | "delegate" | "add_assignee" | "resubmit" | "withdraw" | "terminate" | "admin_reassign" | "admin_override" | "retry_resolution";
|
|
666
|
+
export type WorkflowExpression = {
|
|
667
|
+
op: "literal";
|
|
668
|
+
value: unknown;
|
|
669
|
+
} | {
|
|
670
|
+
op: "path";
|
|
671
|
+
path: string;
|
|
672
|
+
} | {
|
|
673
|
+
op: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "contains";
|
|
674
|
+
left: WorkflowExpression;
|
|
675
|
+
right: WorkflowExpression;
|
|
676
|
+
} | {
|
|
677
|
+
op: "and" | "or";
|
|
678
|
+
values: WorkflowExpression[];
|
|
679
|
+
} | {
|
|
680
|
+
op: "not" | "exists";
|
|
681
|
+
value: WorkflowExpression;
|
|
682
|
+
};
|
|
683
|
+
export interface WorkflowApprovalNode {
|
|
684
|
+
id: string;
|
|
685
|
+
kind: "approval";
|
|
686
|
+
title: string;
|
|
687
|
+
binding: string;
|
|
688
|
+
mode: WorkflowApprovalMode;
|
|
689
|
+
onApprove: string;
|
|
690
|
+
onReject: string;
|
|
691
|
+
allowedOperations?: WorkflowCommand[];
|
|
692
|
+
returnTargets?: string[];
|
|
693
|
+
fieldPolicy?: {
|
|
694
|
+
default?: WorkflowFieldPolicy;
|
|
695
|
+
fields?: Record<string, WorkflowFieldPolicy>;
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
export interface WorkflowConditionNode {
|
|
699
|
+
id: string;
|
|
700
|
+
kind: "condition";
|
|
701
|
+
title?: string;
|
|
702
|
+
branches: Array<{
|
|
703
|
+
when: WorkflowExpression;
|
|
704
|
+
target: string;
|
|
705
|
+
label?: string;
|
|
706
|
+
}>;
|
|
707
|
+
otherwise: string;
|
|
708
|
+
}
|
|
709
|
+
export interface WorkflowEndNode {
|
|
710
|
+
id: string;
|
|
711
|
+
kind: "end";
|
|
712
|
+
title: string;
|
|
713
|
+
outcome: string;
|
|
714
|
+
}
|
|
715
|
+
export type WorkflowNode = WorkflowApprovalNode | WorkflowConditionNode | WorkflowEndNode;
|
|
716
|
+
export interface WorkflowDefinition {
|
|
717
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowDefinition;
|
|
718
|
+
code: string;
|
|
719
|
+
title: string;
|
|
720
|
+
startAt: string;
|
|
721
|
+
inputSchema: Record<string, unknown>;
|
|
722
|
+
organizationContext?: {
|
|
723
|
+
department?: {
|
|
724
|
+
source: "none" | "user_primary_department" | "choose_if_multiple" | "always_choose" | "fixed" | "from_input" | "from_role_scope";
|
|
725
|
+
required?: boolean;
|
|
726
|
+
value?: string;
|
|
727
|
+
path?: string;
|
|
728
|
+
/** Scope dimension used by from_role_scope; defaults to `department`. */
|
|
729
|
+
dimension?: string;
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
nodes: Record<string, WorkflowNode>;
|
|
733
|
+
}
|
|
734
|
+
export type WorkflowBindingProvider = "fixed_users" | "initiator" | "input_users" | "form_field_users" | "department_supervisor" | "app_role" | "app_role_in_scope" | "business_relation" | "previous_node_actor" | "initiator_select" | "application_provider";
|
|
735
|
+
export interface WorkflowBindingEntry {
|
|
736
|
+
provider: WorkflowBindingProvider;
|
|
737
|
+
users?: string[];
|
|
738
|
+
inputPath?: string;
|
|
739
|
+
departmentIdFrom?: string;
|
|
740
|
+
level?: number;
|
|
741
|
+
fallbackToAncestorSupervisor?: boolean;
|
|
742
|
+
roleCode?: string;
|
|
743
|
+
scope?: {
|
|
744
|
+
dimension: string;
|
|
745
|
+
valueFrom?: string;
|
|
746
|
+
value?: string;
|
|
747
|
+
};
|
|
748
|
+
relationCode?: string;
|
|
749
|
+
resourceCode?: string;
|
|
750
|
+
resourceIdFrom?: string;
|
|
751
|
+
providerCode?: string;
|
|
752
|
+
min?: number;
|
|
753
|
+
max?: number;
|
|
754
|
+
}
|
|
755
|
+
export interface WorkflowBinding {
|
|
756
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowBinding;
|
|
757
|
+
workflowCode: string;
|
|
758
|
+
bindings: Record<string, WorkflowBindingEntry>;
|
|
759
|
+
}
|
|
760
|
+
export interface WorkflowCandidatePrincipal {
|
|
761
|
+
userId: string;
|
|
762
|
+
roleAssignmentId?: string;
|
|
763
|
+
roleCode?: string;
|
|
764
|
+
displayName?: string;
|
|
765
|
+
source: string;
|
|
766
|
+
}
|
|
767
|
+
export interface WorkflowPreparationOption {
|
|
768
|
+
value: string;
|
|
769
|
+
label: string;
|
|
770
|
+
description?: string;
|
|
771
|
+
}
|
|
772
|
+
export type WorkflowPreparationRequirement = {
|
|
773
|
+
id: string;
|
|
774
|
+
kind: "choose_department";
|
|
775
|
+
title: string;
|
|
776
|
+
required: boolean;
|
|
777
|
+
candidates: WorkflowPreparationOption[];
|
|
778
|
+
} | {
|
|
779
|
+
id: string;
|
|
780
|
+
kind: "choose_approvers";
|
|
781
|
+
title: string;
|
|
782
|
+
required: boolean;
|
|
783
|
+
min: number;
|
|
784
|
+
max: number;
|
|
785
|
+
candidates: WorkflowCandidatePrincipal[];
|
|
786
|
+
} | {
|
|
787
|
+
id: string;
|
|
788
|
+
kind: string;
|
|
789
|
+
title: string;
|
|
790
|
+
required?: boolean;
|
|
791
|
+
candidates?: Array<WorkflowPreparationOption | WorkflowCandidatePrincipal>;
|
|
792
|
+
min?: number;
|
|
793
|
+
max?: number;
|
|
794
|
+
inputSchema?: Record<string, unknown>;
|
|
795
|
+
uiSchema?: Record<string, unknown>;
|
|
796
|
+
};
|
|
797
|
+
export interface WorkflowPreviewNode {
|
|
798
|
+
nodeId: string;
|
|
799
|
+
kind: WorkflowNode["kind"];
|
|
800
|
+
title?: string;
|
|
801
|
+
result?: Record<string, unknown>;
|
|
802
|
+
assignees: WorkflowCandidatePrincipal[];
|
|
803
|
+
assignmentExplain: Array<Record<string, unknown>>;
|
|
804
|
+
}
|
|
805
|
+
export interface WorkflowPreparation {
|
|
806
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowPreparation;
|
|
807
|
+
preparationId: string;
|
|
808
|
+
status: "needs_input" | "ready";
|
|
809
|
+
requirements: WorkflowPreparationRequirement[];
|
|
810
|
+
preparationToken: string | null;
|
|
811
|
+
preview: {
|
|
812
|
+
certainty: "partial" | "complete";
|
|
813
|
+
nodes: WorkflowPreviewNode[];
|
|
814
|
+
outcome: string | null;
|
|
815
|
+
warnings: Array<Record<string, unknown>>;
|
|
816
|
+
};
|
|
817
|
+
expiresAt: IsoDateTime;
|
|
818
|
+
definitionVersion: number;
|
|
819
|
+
bindingVersion: number;
|
|
820
|
+
inputHash: Sha256Digest;
|
|
821
|
+
}
|
|
822
|
+
export interface WorkflowInstance {
|
|
823
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowInstance;
|
|
824
|
+
engineVersion: "2.0";
|
|
825
|
+
id: string;
|
|
826
|
+
appCode: string;
|
|
827
|
+
environmentKey: string;
|
|
828
|
+
workflowCode: string;
|
|
829
|
+
definitionVersion: number;
|
|
830
|
+
bindingVersion: number;
|
|
831
|
+
businessKey: string;
|
|
832
|
+
generation: number;
|
|
833
|
+
status: "running" | "returned" | "approved" | "rejected" | "withdrawn" | "terminated" | "error";
|
|
834
|
+
initiatorUserId: string;
|
|
835
|
+
initiatorRoleAssignmentId: string;
|
|
836
|
+
dataRef: Record<string, unknown>;
|
|
837
|
+
dataRevision: string;
|
|
838
|
+
currentNodeId: string | null;
|
|
839
|
+
outcome: string | null;
|
|
840
|
+
version: number;
|
|
841
|
+
startedAt: IsoDateTime;
|
|
842
|
+
completedAt: IsoDateTime | null;
|
|
843
|
+
}
|
|
844
|
+
export interface WorkflowTask {
|
|
845
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowTask;
|
|
846
|
+
engineVersion: "2.0";
|
|
847
|
+
id: string;
|
|
848
|
+
instanceId: string;
|
|
849
|
+
workflowCode: string;
|
|
850
|
+
businessKey: string;
|
|
851
|
+
nodeId: string;
|
|
852
|
+
title: string;
|
|
853
|
+
status: "assignment_pending" | "assigned" | "completed" | "rejected" | "returned" | "cancelled" | "expired";
|
|
854
|
+
approvalMode: WorkflowApprovalMode;
|
|
855
|
+
taskKind: "normal" | "return_review" | "resume";
|
|
856
|
+
originTaskId: string | null;
|
|
857
|
+
returnSessionId: string | null;
|
|
858
|
+
version: number;
|
|
859
|
+
dataRef: Record<string, unknown>;
|
|
860
|
+
createdAt: IsoDateTime;
|
|
861
|
+
updatedAt: IsoDateTime;
|
|
862
|
+
}
|
|
863
|
+
export interface WorkflowOperationSurface {
|
|
864
|
+
key: WorkflowCommand | string;
|
|
865
|
+
kind: "workflow_command" | "app_action";
|
|
866
|
+
label: string;
|
|
867
|
+
placement: "primary" | "secondary" | string;
|
|
868
|
+
tone: string;
|
|
869
|
+
visible: boolean;
|
|
870
|
+
enabled: boolean;
|
|
871
|
+
disabledReason?: string;
|
|
872
|
+
inputSchema: Record<string, unknown>;
|
|
873
|
+
uiSchema: Record<string, unknown>;
|
|
874
|
+
execute: {
|
|
875
|
+
method: "POST";
|
|
876
|
+
href: string;
|
|
877
|
+
idempotencyRequired: boolean;
|
|
878
|
+
};
|
|
879
|
+
refresh: string[];
|
|
880
|
+
}
|
|
881
|
+
export interface WorkflowSurface {
|
|
882
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowSurface;
|
|
883
|
+
protocolVersion: "workflow_surface_v2";
|
|
884
|
+
surfaceRevision: Sha256Digest;
|
|
885
|
+
engineVersion: "2.0";
|
|
886
|
+
instance: WorkflowInstance | Record<string, unknown>;
|
|
887
|
+
task: WorkflowTask | Record<string, unknown> | null;
|
|
888
|
+
presentation: Record<string, unknown>;
|
|
889
|
+
fieldPolicy: {
|
|
890
|
+
default: WorkflowFieldPolicy;
|
|
891
|
+
fields: Record<string, WorkflowFieldPolicy>;
|
|
892
|
+
};
|
|
893
|
+
operations: WorkflowOperationSurface[];
|
|
894
|
+
extensions: Record<string, unknown>;
|
|
895
|
+
}
|
|
896
|
+
export interface WorkflowDelegation {
|
|
897
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowDelegation;
|
|
898
|
+
id: string;
|
|
899
|
+
appCode: string;
|
|
900
|
+
workflowCode: string | null;
|
|
901
|
+
delegatorUserId: string;
|
|
902
|
+
delegateUserId: string;
|
|
903
|
+
delegatorRoleAssignmentId: string;
|
|
904
|
+
delegateRoleAssignmentId: string;
|
|
905
|
+
validFrom: IsoDateTime;
|
|
906
|
+
validTo: IsoDateTime;
|
|
907
|
+
status: "active" | "revoked" | "expired";
|
|
908
|
+
reason: string;
|
|
909
|
+
createdBy: string;
|
|
910
|
+
createdAt: IsoDateTime;
|
|
911
|
+
revokedAt: IsoDateTime | null;
|
|
912
|
+
}
|
|
913
|
+
export interface WorkflowDelegationTarget {
|
|
914
|
+
roleAssignmentId: string;
|
|
915
|
+
userId: string;
|
|
916
|
+
role: {
|
|
917
|
+
code: string;
|
|
918
|
+
name: string;
|
|
919
|
+
isAppSuperAdmin: boolean;
|
|
920
|
+
};
|
|
921
|
+
scopeGrants: RoleAssignmentScopeGrant[];
|
|
922
|
+
validFrom: IsoDateTime | null;
|
|
923
|
+
validTo: IsoDateTime | null;
|
|
924
|
+
}
|
|
925
|
+
export interface WorkflowAssigneeProvider {
|
|
926
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowAssigneeProvider;
|
|
927
|
+
id: string;
|
|
928
|
+
appCode: string;
|
|
929
|
+
environmentKey: string;
|
|
930
|
+
code: string;
|
|
931
|
+
endpointPath: string;
|
|
932
|
+
timeoutMs: number;
|
|
933
|
+
status: "active" | "paused";
|
|
934
|
+
signingSecretVersion: number;
|
|
935
|
+
pendingSigningSecretVersion: number | null;
|
|
936
|
+
rotationPending: boolean;
|
|
937
|
+
revision: number;
|
|
938
|
+
signingSecret?: string | null;
|
|
939
|
+
signingSecretReturnedOnce?: boolean;
|
|
940
|
+
createdAt: IsoDateTime;
|
|
941
|
+
updatedAt: IsoDateTime;
|
|
942
|
+
}
|
|
943
|
+
export interface WorkflowAssigneeRequest {
|
|
944
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowAssigneeRequest;
|
|
945
|
+
requestId: string;
|
|
946
|
+
providerCode: string;
|
|
947
|
+
appCode: string;
|
|
948
|
+
environmentKey: string;
|
|
949
|
+
workflowCode: string;
|
|
950
|
+
nodeId: string;
|
|
951
|
+
facts: Record<string, unknown>;
|
|
952
|
+
organizationContext: Record<string, unknown>;
|
|
953
|
+
initiator: WorkflowCandidatePrincipal;
|
|
954
|
+
authzVersion: number;
|
|
955
|
+
}
|
|
956
|
+
export interface WorkflowAssigneeResponse {
|
|
957
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowAssigneeResponse;
|
|
958
|
+
requestId: string;
|
|
959
|
+
candidates: WorkflowCandidatePrincipal[];
|
|
960
|
+
}
|
|
961
|
+
export interface WorkflowKernelDescriptor {
|
|
962
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowKernelDescriptor;
|
|
963
|
+
engineVersion: "2.0";
|
|
964
|
+
instanceId: string;
|
|
965
|
+
appCode: string;
|
|
966
|
+
status: string;
|
|
967
|
+
businessKey: string | null;
|
|
968
|
+
routes: Record<string, string>;
|
|
969
|
+
authorizationMode: "role_session_v2";
|
|
970
|
+
}
|
|
971
|
+
export interface WorkflowKernelWorkItem {
|
|
972
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowKernelWorkItem;
|
|
973
|
+
engineVersion: "2.0";
|
|
974
|
+
appCode: string;
|
|
975
|
+
instanceId: string;
|
|
976
|
+
taskId: string | null;
|
|
977
|
+
workflowCode: string | null;
|
|
978
|
+
businessKey: string | null;
|
|
979
|
+
status: string;
|
|
980
|
+
nodeId: string | null;
|
|
981
|
+
title: string | null;
|
|
982
|
+
dataRef: Record<string, unknown> | null;
|
|
983
|
+
updatedAt: IsoDateTime;
|
|
984
|
+
startedAt: IsoDateTime;
|
|
985
|
+
descriptorHref: string;
|
|
986
|
+
surfaceHref: string;
|
|
987
|
+
authorizationMode: "role_session_v2";
|
|
988
|
+
}
|
|
989
|
+
export interface WorkflowKernelWorkCenter {
|
|
990
|
+
schemaVersion: typeof SCHEMA_VERSIONS.workflowKernelWorkCenter;
|
|
991
|
+
category: "pending" | "completed" | "created";
|
|
992
|
+
roleSessionId: string;
|
|
993
|
+
activeRoleAssignmentId: string;
|
|
994
|
+
items: WorkflowKernelWorkItem[];
|
|
995
|
+
engineCounts: {
|
|
996
|
+
"2.0"?: number;
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
export type AppArtifactKind = "frontend" | "backend" | "config" | "contracts";
|
|
1000
|
+
export interface AppArtifact {
|
|
1001
|
+
kind: AppArtifactKind;
|
|
1002
|
+
digest: Sha256Digest;
|
|
1003
|
+
mediaType: string;
|
|
1004
|
+
size?: number;
|
|
1005
|
+
entrypoint?: string;
|
|
1006
|
+
metadata?: Record<string, unknown>;
|
|
1007
|
+
}
|
|
1008
|
+
export interface AppPackage {
|
|
1009
|
+
schemaVersion: typeof SCHEMA_VERSIONS.appPackage;
|
|
1010
|
+
appCode: string;
|
|
1011
|
+
version: string;
|
|
1012
|
+
createdAt: IsoDateTime;
|
|
1013
|
+
source: {
|
|
1014
|
+
repository: string;
|
|
1015
|
+
commit: string;
|
|
1016
|
+
dirty: boolean;
|
|
1017
|
+
};
|
|
1018
|
+
toolchain: {
|
|
1019
|
+
version: string;
|
|
1020
|
+
contractVersion: typeof OPENXIANGDA_CONTRACT_VERSION;
|
|
1021
|
+
};
|
|
1022
|
+
artifacts: AppArtifact[];
|
|
1023
|
+
manifests: {
|
|
1024
|
+
frontend?: Sha256Digest;
|
|
1025
|
+
backend?: Sha256Digest;
|
|
1026
|
+
config?: Sha256Digest;
|
|
1027
|
+
dataContract?: Sha256Digest;
|
|
1028
|
+
};
|
|
1029
|
+
compatibility: {
|
|
1030
|
+
minimumPlatformVersion: string;
|
|
1031
|
+
requiredCapabilities: string[];
|
|
1032
|
+
};
|
|
1033
|
+
metadata?: Record<string, unknown>;
|
|
1034
|
+
}
|
|
1035
|
+
export interface AppVersion {
|
|
1036
|
+
schemaVersion: typeof SCHEMA_VERSIONS.appVersion;
|
|
1037
|
+
id: string;
|
|
1038
|
+
appCode: string;
|
|
1039
|
+
version: string;
|
|
1040
|
+
packageDigest: Sha256Digest;
|
|
1041
|
+
source: AppPackage["source"];
|
|
1042
|
+
toolchain: AppPackage["toolchain"];
|
|
1043
|
+
revisions: {
|
|
1044
|
+
frontend: string | null;
|
|
1045
|
+
backend: string | null;
|
|
1046
|
+
config: string | null;
|
|
1047
|
+
dataContract: string | null;
|
|
1048
|
+
};
|
|
1049
|
+
metadata: Record<string, unknown>;
|
|
1050
|
+
createdBy: string;
|
|
1051
|
+
createdAt: IsoDateTime;
|
|
1052
|
+
}
|
|
1053
|
+
export interface EnvironmentHead {
|
|
1054
|
+
schemaVersion: typeof SCHEMA_VERSIONS.environmentHead;
|
|
1055
|
+
id: string;
|
|
1056
|
+
appCode: string;
|
|
1057
|
+
environmentKey: string;
|
|
1058
|
+
environmentId: string | null;
|
|
1059
|
+
environmentKind: "development" | "preproduction" | "production";
|
|
1060
|
+
activeAppVersionId: string;
|
|
1061
|
+
revisions: AppVersion["revisions"];
|
|
1062
|
+
revision: number;
|
|
1063
|
+
activatedByDeploymentId: string;
|
|
1064
|
+
activatedBy: string;
|
|
1065
|
+
activatedAt: IsoDateTime;
|
|
1066
|
+
updatedAt: IsoDateTime;
|
|
1067
|
+
activeAppVersion?: AppVersion | null;
|
|
1068
|
+
}
|
|
1069
|
+
export type DeploymentKind = "deploy" | "promotion" | "rollback";
|
|
1070
|
+
export type DeploymentStatus = "queued" | "preparing" | "deploying" | "activating" | "verifying" | "succeeded" | "failed" | "cancelled";
|
|
1071
|
+
export interface DeploymentCheckpoint {
|
|
1072
|
+
stage: string;
|
|
1073
|
+
status: DeploymentStatus;
|
|
1074
|
+
at: IsoDateTime;
|
|
1075
|
+
attempt: number;
|
|
1076
|
+
component?: string;
|
|
1077
|
+
result?: Record<string, unknown>;
|
|
1078
|
+
}
|
|
1079
|
+
export interface DeploymentFailure {
|
|
1080
|
+
code: string;
|
|
1081
|
+
message: string;
|
|
1082
|
+
retryable: boolean;
|
|
1083
|
+
stage?: string;
|
|
1084
|
+
component?: string;
|
|
1085
|
+
details?: Record<string, unknown>;
|
|
1086
|
+
}
|
|
1087
|
+
export interface DeploymentRun {
|
|
1088
|
+
schemaVersion: typeof SCHEMA_VERSIONS.deploymentRun;
|
|
1089
|
+
id: string;
|
|
1090
|
+
appCode: string;
|
|
1091
|
+
environment: {
|
|
1092
|
+
id?: string;
|
|
1093
|
+
kind?: "development" | "preproduction" | "production";
|
|
1094
|
+
};
|
|
1095
|
+
kind: DeploymentKind;
|
|
1096
|
+
packageDigest: Sha256Digest;
|
|
1097
|
+
idempotencyKey: string;
|
|
1098
|
+
status: DeploymentStatus;
|
|
1099
|
+
stage: string;
|
|
1100
|
+
attempt: number;
|
|
1101
|
+
progress: Record<string, unknown>;
|
|
1102
|
+
checkpoints: DeploymentCheckpoint[];
|
|
1103
|
+
failure?: DeploymentFailure;
|
|
1104
|
+
result: Record<string, unknown>;
|
|
1105
|
+
requestedBy: string;
|
|
1106
|
+
startedAt?: IsoDateTime;
|
|
1107
|
+
finishedAt?: IsoDateTime;
|
|
1108
|
+
createdAt: IsoDateTime;
|
|
1109
|
+
updatedAt: IsoDateTime;
|
|
1110
|
+
}
|
|
1111
|
+
export interface PlatformCapabilities {
|
|
1112
|
+
schemaVersion: typeof SCHEMA_VERSIONS.platformCapabilities;
|
|
1113
|
+
apiVersion: "v2";
|
|
1114
|
+
contractVersion: typeof OPENXIANGDA_CONTRACT_VERSION;
|
|
1115
|
+
platformVersion: string;
|
|
1116
|
+
features: Record<string, {
|
|
1117
|
+
version: string;
|
|
1118
|
+
status: "available" | "preview" | "planned";
|
|
1119
|
+
}>;
|
|
1120
|
+
deployment: {
|
|
1121
|
+
executionOwner: "platform";
|
|
1122
|
+
durableRuns: true;
|
|
1123
|
+
clientCanCheckpoint: false;
|
|
1124
|
+
};
|
|
1125
|
+
oauth2?: {
|
|
1126
|
+
tokenEndpoint: string;
|
|
1127
|
+
grantTypes: ["client_credentials"];
|
|
1128
|
+
clientAuthenticationMethods: ["client_secret_basic"];
|
|
1129
|
+
accessTokenTtlSeconds: number;
|
|
1130
|
+
supportedScopes: string[];
|
|
1131
|
+
environmentBoundClients: boolean;
|
|
1132
|
+
dualSecretRotation: boolean;
|
|
1133
|
+
defaultRotationGracePeriodSeconds: number;
|
|
1134
|
+
clientRateLimit: boolean;
|
|
1135
|
+
auditEvents: boolean;
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
export interface NextAction {
|
|
1139
|
+
code: string;
|
|
1140
|
+
label: string;
|
|
1141
|
+
command?: string;
|
|
1142
|
+
href?: string;
|
|
1143
|
+
}
|
|
1144
|
+
export interface DevkitResult<T> {
|
|
1145
|
+
ok: boolean;
|
|
1146
|
+
operation: string;
|
|
1147
|
+
workspace: WorkspaceIdentity;
|
|
1148
|
+
data?: T;
|
|
1149
|
+
diagnostics: Diagnostic[];
|
|
1150
|
+
nextActions: NextAction[];
|
|
1151
|
+
traceId?: string;
|
|
1152
|
+
}
|
|
1153
|
+
//# sourceMappingURL=types.d.ts.map
|