@inf-monkeys-tech/monkeys 1.0.18 → 1.0.19
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/lib/contracts/continuity.d.ts +2 -2
- package/lib/contracts/continuity.d.ts.map +1 -1
- package/lib/contracts/continuity.js +39 -2
- package/lib/contracts/continuity.js.map +1 -1
- package/lib/contracts/index.d.ts +1 -0
- package/lib/contracts/index.d.ts.map +1 -1
- package/lib/contracts/index.js +1 -0
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/workflow-runtime.d.ts +287 -0
- package/lib/contracts/workflow-runtime.d.ts.map +1 -0
- package/lib/contracts/workflow-runtime.js +198 -0
- package/lib/contracts/workflow-runtime.js.map +1 -0
- package/lib/esm/contracts/index.mjs +217 -2
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +222 -3
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +222 -3
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/application-run.schema.json +0 -1
- package/lib/json-schema/index.json +5 -1
- package/lib/json-schema/workflow-catalog-entry.schema.json +238 -0
- package/lib/json-schema/workflow-completion-commit.schema.json +1163 -0
- package/lib/json-schema/workflow-completion-receipt.schema.json +160 -0
- package/lib/json-schema/workflow-publication.schema.json +168 -0
- package/lib/schemas/index.d.ts +284 -2
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +11 -1
- package/lib/schemas/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -77,12 +77,12 @@ export declare const ApplicationRunSchema: z.ZodObject<{
|
|
|
77
77
|
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
78
78
|
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
79
79
|
}, z.core.$strict>;
|
|
80
|
-
runtimeLedgerRef: z.ZodObject<{
|
|
80
|
+
runtimeLedgerRef: z.ZodOptional<z.ZodObject<{
|
|
81
81
|
kind: z.ZodString;
|
|
82
82
|
id: z.ZodString;
|
|
83
83
|
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
84
84
|
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
85
|
-
}, z.core.$strict
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
86
|
requestId: z.ZodString;
|
|
87
87
|
actorRef: z.ZodObject<{
|
|
88
88
|
kind: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuity.d.ts","sourceRoot":"","sources":["../../src/contracts/continuity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkBtC,CAAC;AAEJ,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;kBAa1B,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"continuity.d.ts","sourceRoot":"","sources":["../../src/contracts/continuity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkBtC,CAAC;AAEJ,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;kBAa1B,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqD7B,CAAC;AAEL,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;kBAY0E,CAAC;AAEjH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -38,7 +38,7 @@ exports.ApplicationRunSchema = zod_1.z
|
|
|
38
38
|
contract: zod_1.z.literal('ApplicationRun'),
|
|
39
39
|
runId: common_1.ContractIdentifierSchema,
|
|
40
40
|
definitionRef: common_1.EntityRefSchema,
|
|
41
|
-
runtimeLedgerRef: common_1.EntityRefSchema,
|
|
41
|
+
runtimeLedgerRef: common_1.EntityRefSchema.optional(),
|
|
42
42
|
requestId: common_1.ContractIdentifierSchema,
|
|
43
43
|
actorRef: common_1.EntityRefSchema,
|
|
44
44
|
status: zod_1.z.enum(['PENDING', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLED', 'EXPIRED']),
|
|
@@ -49,7 +49,44 @@ exports.ApplicationRunSchema = zod_1.z
|
|
|
49
49
|
expiresAt: common_1.IsoDateTimeSchema.optional(),
|
|
50
50
|
metadata: common_1.JsonObjectSchema.default({}),
|
|
51
51
|
})
|
|
52
|
-
.strict()
|
|
52
|
+
.strict()
|
|
53
|
+
.superRefine((run, context) => {
|
|
54
|
+
if (run.definitionRef.kind !== 'workflow-definition') {
|
|
55
|
+
context.addIssue({
|
|
56
|
+
code: 'custom',
|
|
57
|
+
path: ['definitionRef', 'kind'],
|
|
58
|
+
message: 'definitionRef must reference a workflow-definition.',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (run.runtimeLedgerRef && run.runtimeLedgerRef.kind !== 'workflow-run') {
|
|
62
|
+
context.addIssue({
|
|
63
|
+
code: 'custom',
|
|
64
|
+
path: ['runtimeLedgerRef', 'kind'],
|
|
65
|
+
message: 'runtimeLedgerRef must reference a workflow-run.',
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if ((run.status === 'RUNNING' || run.status === 'COMPLETED' || run.status === 'CANCELLED') && !run.runtimeLedgerRef) {
|
|
69
|
+
context.addIssue({
|
|
70
|
+
code: 'custom',
|
|
71
|
+
path: ['runtimeLedgerRef'],
|
|
72
|
+
message: `${run.status} ApplicationRun requires runtimeLedgerRef.`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (run.status === 'RUNNING' && !run.startedAt) {
|
|
76
|
+
context.addIssue({
|
|
77
|
+
code: 'custom',
|
|
78
|
+
path: ['startedAt'],
|
|
79
|
+
message: 'RUNNING ApplicationRun requires startedAt.',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (['COMPLETED', 'FAILED', 'CANCELLED', 'EXPIRED'].includes(run.status) && !run.completedAt) {
|
|
83
|
+
context.addIssue({
|
|
84
|
+
code: 'custom',
|
|
85
|
+
path: ['completedAt'],
|
|
86
|
+
message: `Terminal ApplicationRun status ${run.status} requires completedAt.`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
53
90
|
exports.ExpiringAccessGrantSchema = zod_1.z
|
|
54
91
|
.object({
|
|
55
92
|
contract: zod_1.z.literal('ExpiringAccessGrant'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuity.js","sourceRoot":"","sources":["../../src/contracts/continuity.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,qCAMkB;AAEL,QAAA,4BAA4B,GAAG,OAAC;KAC1C,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC;IAC7C,QAAQ,EAAE,iCAAwB;IAClC,MAAM,EAAE,iCAAwB;IAChC,SAAS,EAAE,wBAAe,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,wBAAe,CAAC,QAAQ,EAAE;IACnC,MAAM,EAAE,wBAAe,CAAC,QAAQ,EAAE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AC5B,SAAS,EAAE,0BAAiB,CAAC,QAAQ,EAAE;CACxC,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,kCAAkC,CAAC,CAAC"}
|
package/lib/contracts/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
|
package/lib/contracts/index.js
CHANGED
|
@@ -28,4 +28,5 @@ __exportStar(require("./tenant"), exports);
|
|
|
28
28
|
__exportStar(require("./theme"), exports);
|
|
29
29
|
__exportStar(require("./trend"), exports);
|
|
30
30
|
__exportStar(require("./workflow-definition"), exports);
|
|
31
|
+
__exportStar(require("./workflow-runtime"), exports);
|
|
31
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,0CAAwB;AACxB,+CAA6B;AAC7B,2CAAyB;AACzB,4CAA0B;AAC1B,+CAA6B;AAC7B,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,wDAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,0CAAwB;AACxB,+CAA6B;AAC7B,2CAAyB;AACzB,4CAA0B;AAC1B,+CAA6B;AAC7B,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,wDAAsC;AACtC,qDAAmC"}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const WorkflowCatalogEntrySchema: z.ZodObject<{
|
|
3
|
+
contract: z.ZodLiteral<"WorkflowCatalogEntry">;
|
|
4
|
+
workflowId: z.ZodString;
|
|
5
|
+
teamId: z.ZodString;
|
|
6
|
+
creatorRef: z.ZodObject<{
|
|
7
|
+
kind: z.ZodString;
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
10
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
currentDefinitionRef: z.ZodObject<{
|
|
13
|
+
kind: z.ZodString;
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
16
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
lifecycle: z.ZodEnum<{
|
|
19
|
+
ACTIVE: "ACTIVE";
|
|
20
|
+
DELETED: "DELETED";
|
|
21
|
+
}>;
|
|
22
|
+
asset: z.ZodObject<{
|
|
23
|
+
preset: z.ZodBoolean;
|
|
24
|
+
marketplacePublished: z.ZodBoolean;
|
|
25
|
+
publishConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>>;
|
|
26
|
+
sort: z.ZodNumber;
|
|
27
|
+
forkFromRef: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
kind: z.ZodString;
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
31
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
notAuthorized: z.ZodBoolean;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
createdAt: z.ZodString;
|
|
36
|
+
updatedAt: z.ZodString;
|
|
37
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export declare const WorkflowPublicationSchema: z.ZodObject<{
|
|
40
|
+
contract: z.ZodLiteral<"WorkflowPublication">;
|
|
41
|
+
publicationId: z.ZodString;
|
|
42
|
+
definitionRef: z.ZodObject<{
|
|
43
|
+
kind: z.ZodString;
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
46
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
runtimeDefinitionRef: z.ZodObject<{
|
|
49
|
+
kind: z.ZodString;
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
52
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
sourceHash: z.ZodString;
|
|
55
|
+
compiledHash: z.ZodString;
|
|
56
|
+
status: z.ZodEnum<{
|
|
57
|
+
FAILED: "FAILED";
|
|
58
|
+
PENDING: "PENDING";
|
|
59
|
+
PUBLISHED: "PUBLISHED";
|
|
60
|
+
RETIRED: "RETIRED";
|
|
61
|
+
}>;
|
|
62
|
+
publisherRef: z.ZodObject<{
|
|
63
|
+
kind: z.ZodString;
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
66
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
publishedAt: z.ZodOptional<z.ZodString>;
|
|
69
|
+
failureReason: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
export declare const WorkflowCompletionCommitSchema: z.ZodObject<{
|
|
72
|
+
contract: z.ZodLiteral<"WorkflowCompletionCommit">;
|
|
73
|
+
commitId: z.ZodString;
|
|
74
|
+
run: z.ZodObject<{
|
|
75
|
+
contract: z.ZodLiteral<"ApplicationRun">;
|
|
76
|
+
runId: z.ZodString;
|
|
77
|
+
definitionRef: z.ZodObject<{
|
|
78
|
+
kind: z.ZodString;
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
81
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
runtimeLedgerRef: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
kind: z.ZodString;
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
87
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strict>>;
|
|
89
|
+
requestId: z.ZodString;
|
|
90
|
+
actorRef: z.ZodObject<{
|
|
91
|
+
kind: z.ZodString;
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
94
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
status: z.ZodEnum<{
|
|
97
|
+
FAILED: "FAILED";
|
|
98
|
+
CANCELLED: "CANCELLED";
|
|
99
|
+
PENDING: "PENDING";
|
|
100
|
+
RUNNING: "RUNNING";
|
|
101
|
+
COMPLETED: "COMPLETED";
|
|
102
|
+
EXPIRED: "EXPIRED";
|
|
103
|
+
}>;
|
|
104
|
+
inputRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
105
|
+
kind: z.ZodString;
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
108
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strict>>>;
|
|
110
|
+
outputRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
111
|
+
kind: z.ZodString;
|
|
112
|
+
id: z.ZodString;
|
|
113
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
114
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strict>>>;
|
|
116
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
117
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
118
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
119
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
outputs: z.ZodArray<z.ZodObject<{
|
|
122
|
+
contract: z.ZodLiteral<"OutputRecord">;
|
|
123
|
+
outputId: z.ZodString;
|
|
124
|
+
runRef: z.ZodObject<{
|
|
125
|
+
kind: z.ZodString;
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
128
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
outputPort: z.ZodString;
|
|
131
|
+
value: z.ZodOptional<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
|
|
132
|
+
artifactRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
133
|
+
kind: z.ZodString;
|
|
134
|
+
id: z.ZodString;
|
|
135
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
136
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strict>>>;
|
|
138
|
+
schemaRef: z.ZodOptional<z.ZodString>;
|
|
139
|
+
createdAt: z.ZodString;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
artifacts: z.ZodArray<z.ZodObject<{
|
|
142
|
+
contract: z.ZodLiteral<"ArtifactManifest">;
|
|
143
|
+
artifactId: z.ZodString;
|
|
144
|
+
kind: z.ZodString;
|
|
145
|
+
mimeType: z.ZodString;
|
|
146
|
+
byteSize: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
sha256: z.ZodString;
|
|
148
|
+
storage: z.ZodObject<{
|
|
149
|
+
provider: z.ZodString;
|
|
150
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
151
|
+
key: z.ZodString;
|
|
152
|
+
region: z.ZodOptional<z.ZodString>;
|
|
153
|
+
url: z.ZodOptional<z.ZodString>;
|
|
154
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
sourceRef: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
kind: z.ZodString;
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
160
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, z.core.$strict>>;
|
|
162
|
+
runRef: z.ZodObject<{
|
|
163
|
+
kind: z.ZodString;
|
|
164
|
+
id: z.ZodString;
|
|
165
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
166
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, z.core.$strict>;
|
|
168
|
+
outputRef: z.ZodObject<{
|
|
169
|
+
kind: z.ZodString;
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
172
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$strict>;
|
|
174
|
+
producer: z.ZodObject<{
|
|
175
|
+
service: z.ZodString;
|
|
176
|
+
version: z.ZodString;
|
|
177
|
+
capabilityRef: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
kind: z.ZodString;
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
181
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
access: z.ZodObject<{
|
|
185
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
186
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
187
|
+
ownerRef: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
kind: z.ZodString;
|
|
189
|
+
id: z.ZodString;
|
|
190
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
191
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>>;
|
|
193
|
+
visibility: z.ZodEnum<{
|
|
194
|
+
private: "private";
|
|
195
|
+
team: "team";
|
|
196
|
+
tenant: "tenant";
|
|
197
|
+
public: "public";
|
|
198
|
+
}>;
|
|
199
|
+
}, z.core.$strict>;
|
|
200
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>>;
|
|
201
|
+
createdAt: z.ZodString;
|
|
202
|
+
}, z.core.$strict>>;
|
|
203
|
+
lineage: z.ZodObject<{
|
|
204
|
+
contract: z.ZodLiteral<"LineageRecord">;
|
|
205
|
+
lineageId: z.ZodString;
|
|
206
|
+
subjectRef: z.ZodObject<{
|
|
207
|
+
kind: z.ZodString;
|
|
208
|
+
id: z.ZodString;
|
|
209
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
210
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
sourceRecords: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
213
|
+
sourceId: z.ZodString;
|
|
214
|
+
recordId: z.ZodString;
|
|
215
|
+
recordVersion: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
216
|
+
hash: z.ZodString;
|
|
217
|
+
}, z.core.$strict>>>;
|
|
218
|
+
bodyRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
219
|
+
kind: z.ZodString;
|
|
220
|
+
id: z.ZodString;
|
|
221
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
222
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
223
|
+
}, z.core.$strict>>>;
|
|
224
|
+
runRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
225
|
+
kind: z.ZodString;
|
|
226
|
+
id: z.ZodString;
|
|
227
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
228
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
229
|
+
}, z.core.$strict>>>;
|
|
230
|
+
outputRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
231
|
+
kind: z.ZodString;
|
|
232
|
+
id: z.ZodString;
|
|
233
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
234
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
235
|
+
}, z.core.$strict>>>;
|
|
236
|
+
artifactRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
237
|
+
kind: z.ZodString;
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
240
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strict>>>;
|
|
242
|
+
actorRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
243
|
+
kind: z.ZodString;
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
246
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
247
|
+
}, z.core.$strict>>>;
|
|
248
|
+
evidenceRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
249
|
+
kind: z.ZodString;
|
|
250
|
+
id: z.ZodString;
|
|
251
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
252
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
253
|
+
}, z.core.$strict>>>;
|
|
254
|
+
recordedAt: z.ZodString;
|
|
255
|
+
}, z.core.$strict>;
|
|
256
|
+
completedAt: z.ZodString;
|
|
257
|
+
}, z.core.$strict>;
|
|
258
|
+
export declare const WorkflowCompletionReceiptSchema: z.ZodObject<{
|
|
259
|
+
contract: z.ZodLiteral<"WorkflowCompletionReceipt">;
|
|
260
|
+
commitId: z.ZodString;
|
|
261
|
+
runRef: z.ZodObject<{
|
|
262
|
+
kind: z.ZodString;
|
|
263
|
+
id: z.ZodString;
|
|
264
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
265
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
266
|
+
}, z.core.$strict>;
|
|
267
|
+
outputRefs: z.ZodArray<z.ZodObject<{
|
|
268
|
+
kind: z.ZodString;
|
|
269
|
+
id: z.ZodString;
|
|
270
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
271
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
272
|
+
}, z.core.$strict>>;
|
|
273
|
+
artifactRefs: z.ZodArray<z.ZodObject<{
|
|
274
|
+
kind: z.ZodString;
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
version: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
277
|
+
ownerRepo: z.ZodOptional<z.ZodString>;
|
|
278
|
+
}, z.core.$strict>>;
|
|
279
|
+
contentHash: z.ZodString;
|
|
280
|
+
committedAt: z.ZodString;
|
|
281
|
+
idempotentReplay: z.ZodBoolean;
|
|
282
|
+
}, z.core.$strict>;
|
|
283
|
+
export type WorkflowPublication = z.infer<typeof WorkflowPublicationSchema>;
|
|
284
|
+
export type WorkflowCatalogEntry = z.infer<typeof WorkflowCatalogEntrySchema>;
|
|
285
|
+
export type WorkflowCompletionCommit = z.infer<typeof WorkflowCompletionCommitSchema>;
|
|
286
|
+
export type WorkflowCompletionReceipt = z.infer<typeof WorkflowCompletionReceiptSchema>;
|
|
287
|
+
//# sourceMappingURL=workflow-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-runtime.d.ts","sourceRoot":"","sources":["../../src/contracts/workflow-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuDnC,CAAC;AAEL,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2ClC,CAAC;AAEL,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyDvC,CAAC;AAEL,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;kBAsCxC,CAAC;AAEL,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowCompletionReceiptSchema = exports.WorkflowCompletionCommitSchema = exports.WorkflowPublicationSchema = exports.WorkflowCatalogEntrySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const artifact_1 = require("./artifact");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
const continuity_1 = require("./continuity");
|
|
8
|
+
const data_1 = require("./data");
|
|
9
|
+
exports.WorkflowCatalogEntrySchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
contract: zod_1.z.literal('WorkflowCatalogEntry'),
|
|
12
|
+
workflowId: common_1.ContractIdentifierSchema,
|
|
13
|
+
teamId: common_1.ContractIdentifierSchema,
|
|
14
|
+
creatorRef: common_1.EntityRefSchema,
|
|
15
|
+
currentDefinitionRef: common_1.EntityRefSchema,
|
|
16
|
+
lifecycle: zod_1.z.enum(['ACTIVE', 'DELETED']),
|
|
17
|
+
asset: zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
preset: zod_1.z.boolean(),
|
|
20
|
+
marketplacePublished: zod_1.z.boolean(),
|
|
21
|
+
publishConfig: common_1.JsonObjectSchema.optional(),
|
|
22
|
+
sort: zod_1.z.number().int(),
|
|
23
|
+
forkFromRef: common_1.EntityRefSchema.optional(),
|
|
24
|
+
notAuthorized: zod_1.z.boolean(),
|
|
25
|
+
})
|
|
26
|
+
.strict(),
|
|
27
|
+
createdAt: common_1.IsoDateTimeSchema,
|
|
28
|
+
updatedAt: common_1.IsoDateTimeSchema,
|
|
29
|
+
deletedAt: common_1.IsoDateTimeSchema.optional(),
|
|
30
|
+
})
|
|
31
|
+
.strict()
|
|
32
|
+
.superRefine((entry, context) => {
|
|
33
|
+
if (entry.creatorRef.kind !== 'user' &&
|
|
34
|
+
entry.creatorRef.kind !== 'service') {
|
|
35
|
+
context.addIssue({
|
|
36
|
+
code: 'custom',
|
|
37
|
+
path: ['creatorRef', 'kind'],
|
|
38
|
+
message: 'creatorRef must reference a user or service.',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (entry.currentDefinitionRef.kind !== 'workflow-definition') {
|
|
42
|
+
context.addIssue({
|
|
43
|
+
code: 'custom',
|
|
44
|
+
path: ['currentDefinitionRef', 'kind'],
|
|
45
|
+
message: 'currentDefinitionRef must reference a workflow-definition.',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (entry.lifecycle === 'DELETED' && !entry.deletedAt) {
|
|
49
|
+
context.addIssue({
|
|
50
|
+
code: 'custom',
|
|
51
|
+
path: ['deletedAt'],
|
|
52
|
+
message: 'Deleted workflow catalog entries require deletedAt.',
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (entry.lifecycle === 'ACTIVE' && entry.deletedAt) {
|
|
56
|
+
context.addIssue({
|
|
57
|
+
code: 'custom',
|
|
58
|
+
path: ['deletedAt'],
|
|
59
|
+
message: 'Active workflow catalog entries cannot declare deletedAt.',
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
exports.WorkflowPublicationSchema = zod_1.z
|
|
64
|
+
.object({
|
|
65
|
+
contract: zod_1.z.literal('WorkflowPublication'),
|
|
66
|
+
publicationId: common_1.ContractIdentifierSchema,
|
|
67
|
+
definitionRef: common_1.EntityRefSchema,
|
|
68
|
+
runtimeDefinitionRef: common_1.EntityRefSchema,
|
|
69
|
+
sourceHash: common_1.Sha256Schema,
|
|
70
|
+
compiledHash: common_1.Sha256Schema,
|
|
71
|
+
status: zod_1.z.enum(['PENDING', 'PUBLISHED', 'FAILED', 'RETIRED']),
|
|
72
|
+
publisherRef: common_1.EntityRefSchema,
|
|
73
|
+
publishedAt: common_1.IsoDateTimeSchema.optional(),
|
|
74
|
+
failureReason: zod_1.z.string().trim().min(1).optional(),
|
|
75
|
+
})
|
|
76
|
+
.strict()
|
|
77
|
+
.superRefine((publication, context) => {
|
|
78
|
+
if (publication.definitionRef.kind !== 'workflow-definition') {
|
|
79
|
+
context.addIssue({
|
|
80
|
+
code: 'custom',
|
|
81
|
+
path: ['definitionRef', 'kind'],
|
|
82
|
+
message: 'definitionRef must reference a workflow-definition.',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (publication.runtimeDefinitionRef.kind !== 'conductor-workflow-definition') {
|
|
86
|
+
context.addIssue({
|
|
87
|
+
code: 'custom',
|
|
88
|
+
path: ['runtimeDefinitionRef', 'kind'],
|
|
89
|
+
message: 'runtimeDefinitionRef must reference a conductor-workflow-definition.',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (publication.status === 'PUBLISHED' && !publication.publishedAt) {
|
|
93
|
+
context.addIssue({
|
|
94
|
+
code: 'custom',
|
|
95
|
+
path: ['publishedAt'],
|
|
96
|
+
message: 'Published workflow publications require publishedAt.',
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (publication.status === 'FAILED' && !publication.failureReason) {
|
|
100
|
+
context.addIssue({
|
|
101
|
+
code: 'custom',
|
|
102
|
+
path: ['failureReason'],
|
|
103
|
+
message: 'Failed workflow publications require failureReason.',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
exports.WorkflowCompletionCommitSchema = zod_1.z
|
|
108
|
+
.object({
|
|
109
|
+
contract: zod_1.z.literal('WorkflowCompletionCommit'),
|
|
110
|
+
commitId: common_1.ContractIdentifierSchema,
|
|
111
|
+
run: continuity_1.ApplicationRunSchema,
|
|
112
|
+
outputs: zod_1.z.array(artifact_1.OutputRecordSchema),
|
|
113
|
+
artifacts: zod_1.z.array(artifact_1.ArtifactManifestSchema),
|
|
114
|
+
lineage: data_1.LineageRecordSchema,
|
|
115
|
+
completedAt: common_1.IsoDateTimeSchema,
|
|
116
|
+
})
|
|
117
|
+
.strict()
|
|
118
|
+
.superRefine((commit, context) => {
|
|
119
|
+
const expectedRunId = commit.run.runId;
|
|
120
|
+
const referencesRun = (value) => value.runRef.kind === 'application-run' && value.runRef.id === expectedRunId;
|
|
121
|
+
commit.outputs.forEach((output, index) => {
|
|
122
|
+
if (!referencesRun(output)) {
|
|
123
|
+
context.addIssue({
|
|
124
|
+
code: 'custom',
|
|
125
|
+
path: ['outputs', index, 'runRef'],
|
|
126
|
+
message: 'Every output must reference the committed ApplicationRun.',
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
commit.artifacts.forEach((artifact, index) => {
|
|
131
|
+
if (!referencesRun(artifact)) {
|
|
132
|
+
context.addIssue({
|
|
133
|
+
code: 'custom',
|
|
134
|
+
path: ['artifacts', index, 'runRef'],
|
|
135
|
+
message: 'Every artifact must reference the committed ApplicationRun.',
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
if (commit.lineage.subjectRef.kind !== 'application-run' ||
|
|
140
|
+
commit.lineage.subjectRef.id !== expectedRunId) {
|
|
141
|
+
context.addIssue({
|
|
142
|
+
code: 'custom',
|
|
143
|
+
path: ['lineage', 'subjectRef'],
|
|
144
|
+
message: 'Completion lineage must use the committed ApplicationRun as its subject.',
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const outputIds = new Set(commit.outputs.map(output => output.outputId));
|
|
148
|
+
commit.artifacts.forEach((artifact, index) => {
|
|
149
|
+
if (artifact.outputRef.kind !== 'workflow-output' ||
|
|
150
|
+
!outputIds.has(artifact.outputRef.id)) {
|
|
151
|
+
context.addIssue({
|
|
152
|
+
code: 'custom',
|
|
153
|
+
path: ['artifacts', index, 'outputRef'],
|
|
154
|
+
message: 'Artifact outputRef must reference an output in the same commit.',
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
exports.WorkflowCompletionReceiptSchema = zod_1.z
|
|
160
|
+
.object({
|
|
161
|
+
contract: zod_1.z.literal('WorkflowCompletionReceipt'),
|
|
162
|
+
commitId: common_1.ContractIdentifierSchema,
|
|
163
|
+
runRef: common_1.EntityRefSchema,
|
|
164
|
+
outputRefs: zod_1.z.array(common_1.EntityRefSchema),
|
|
165
|
+
artifactRefs: zod_1.z.array(common_1.EntityRefSchema),
|
|
166
|
+
contentHash: common_1.Sha256Schema,
|
|
167
|
+
committedAt: common_1.IsoDateTimeSchema,
|
|
168
|
+
idempotentReplay: zod_1.z.boolean(),
|
|
169
|
+
})
|
|
170
|
+
.strict()
|
|
171
|
+
.superRefine((receipt, context) => {
|
|
172
|
+
if (receipt.runRef.kind !== 'application-run') {
|
|
173
|
+
context.addIssue({
|
|
174
|
+
code: 'custom',
|
|
175
|
+
path: ['runRef', 'kind'],
|
|
176
|
+
message: 'runRef must reference an application-run.',
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
receipt.outputRefs.forEach((ref, index) => {
|
|
180
|
+
if (ref.kind !== 'workflow-output') {
|
|
181
|
+
context.addIssue({
|
|
182
|
+
code: 'custom',
|
|
183
|
+
path: ['outputRefs', index, 'kind'],
|
|
184
|
+
message: 'outputRefs must reference workflow-output records.',
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
receipt.artifactRefs.forEach((ref, index) => {
|
|
189
|
+
if (ref.kind !== 'artifact') {
|
|
190
|
+
context.addIssue({
|
|
191
|
+
code: 'custom',
|
|
192
|
+
path: ['artifactRefs', index, 'kind'],
|
|
193
|
+
message: 'artifactRefs must reference artifacts.',
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
//# sourceMappingURL=workflow-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-runtime.js","sourceRoot":"","sources":["../../src/contracts/workflow-runtime.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,yCAAwE;AACxE,qCAMkB;AAClB,6CAAoD;AACpD,iCAA6C;AAEhC,QAAA,0BAA0B,GAAG,OAAC;KACxC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