@dev-ecosystem/core 0.1.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/README.md +0 -0
- package/dist/capabilities/devforge.capabilities.json +0 -0
- package/dist/capabilities/mediaproc.capabilities.json +0 -0
- package/dist/capabilities/orbyt.capabilities.json +0 -0
- package/dist/capabilities/vaulta.capabilities.json +0 -0
- package/dist/contracts/adapter.contract.d.ts +1 -0
- package/dist/contracts/adapter.contract.d.ts.map +1 -0
- package/dist/contracts/adapter.contract.js +2 -0
- package/dist/contracts/adapter.contract.js.map +1 -0
- package/dist/contracts/cli.contract.d.ts +1 -0
- package/dist/contracts/cli.contract.d.ts.map +1 -0
- package/dist/contracts/cli.contract.js +2 -0
- package/dist/contracts/cli.contract.js.map +1 -0
- package/dist/contracts/engine.contract.d.ts +1 -0
- package/dist/contracts/engine.contract.d.ts.map +1 -0
- package/dist/contracts/engine.contract.js +2 -0
- package/dist/contracts/engine.contract.js.map +1 -0
- package/dist/contracts/plugin.contract.d.ts +1 -0
- package/dist/contracts/plugin.contract.d.ts.map +1 -0
- package/dist/contracts/plugin.contract.js +2 -0
- package/dist/contracts/plugin.contract.js.map +1 -0
- package/dist/contracts/vault.contract.d.ts +1 -0
- package/dist/contracts/vault.contract.d.ts.map +1 -0
- package/dist/contracts/vault.contract.js +2 -0
- package/dist/contracts/vault.contract.js.map +1 -0
- package/dist/contracts/workflow.contract.d.ts +1 -0
- package/dist/contracts/workflow.contract.d.ts.map +1 -0
- package/dist/contracts/workflow.contract.js +2 -0
- package/dist/contracts/workflow.contract.js.map +1 -0
- package/dist/errors/BaseError.d.ts +108 -0
- package/dist/errors/BaseError.d.ts.map +1 -0
- package/dist/errors/BaseError.js +163 -0
- package/dist/errors/BaseError.js.map +1 -0
- package/dist/errors/ErrorCodes.d.ts +111 -0
- package/dist/errors/ErrorCodes.d.ts.map +1 -0
- package/dist/errors/ErrorCodes.js +130 -0
- package/dist/errors/ErrorCodes.js.map +1 -0
- package/dist/errors/ErrorTypes.d.ts +144 -0
- package/dist/errors/ErrorTypes.d.ts.map +1 -0
- package/dist/errors/ErrorTypes.js +172 -0
- package/dist/errors/ErrorTypes.js.map +1 -0
- package/dist/errors/devforge.codes.d.ts +71 -0
- package/dist/errors/devforge.codes.d.ts.map +1 -0
- package/dist/errors/devforge.codes.js +84 -0
- package/dist/errors/devforge.codes.js.map +1 -0
- package/dist/errors/devforge.errors.d.ts +126 -0
- package/dist/errors/devforge.errors.d.ts.map +1 -0
- package/dist/errors/devforge.errors.js +139 -0
- package/dist/errors/devforge.errors.js.map +1 -0
- package/dist/errors/index.d.ts +22 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +37 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/mediaproc.codes.d.ts +92 -0
- package/dist/errors/mediaproc.codes.d.ts.map +1 -0
- package/dist/errors/mediaproc.codes.js +108 -0
- package/dist/errors/mediaproc.codes.js.map +1 -0
- package/dist/errors/mediaproc.errors.d.ts +120 -0
- package/dist/errors/mediaproc.errors.d.ts.map +1 -0
- package/dist/errors/mediaproc.errors.js +133 -0
- package/dist/errors/mediaproc.errors.js.map +1 -0
- package/dist/errors/orbyt.errors.d.ts +168 -0
- package/dist/errors/orbyt.errors.d.ts.map +1 -0
- package/dist/errors/orbyt.errors.js +187 -0
- package/dist/errors/orbyt.errors.js.map +1 -0
- package/dist/errors/vaulta.codes.d.ts +81 -0
- package/dist/errors/vaulta.codes.d.ts.map +1 -0
- package/dist/errors/vaulta.codes.js +94 -0
- package/dist/errors/vaulta.codes.js.map +1 -0
- package/dist/errors/vaulta.errors.d.ts +135 -0
- package/dist/errors/vaulta.errors.d.ts.map +1 -0
- package/dist/errors/vaulta.errors.js +154 -0
- package/dist/errors/vaulta.errors.js.map +1 -0
- package/dist/exit-codes/ExitCodes.d.ts +136 -0
- package/dist/exit-codes/ExitCodes.d.ts.map +1 -0
- package/dist/exit-codes/ExitCodes.js +229 -0
- package/dist/exit-codes/ExitCodes.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/LogFormat.d.ts +1 -0
- package/dist/logging/LogFormat.d.ts.map +1 -0
- package/dist/logging/LogFormat.js +2 -0
- package/dist/logging/LogFormat.js.map +1 -0
- package/dist/manifests/adapter.manifest.json +0 -0
- package/dist/manifests/plugin.manifest.json +0 -0
- package/dist/manifests/workflow.manifest.json +0 -0
- package/dist/schemas/adapter.schema.json +0 -0
- package/dist/schemas/capability.schem.json +0 -0
- package/dist/schemas/index.d.ts +401 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +107 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/manifest.schame.json +0 -0
- package/dist/schemas/plugin.schema.json +0 -0
- package/dist/schemas/workflow.schema.json +485 -0
- package/dist/schemas/workflow.schema.zod.d.ts +450 -0
- package/dist/schemas/workflow.schema.zod.d.ts.map +1 -0
- package/dist/schemas/workflow.schema.zod.js +234 -0
- package/dist/schemas/workflow.schema.zod.js.map +1 -0
- package/dist/types/adapter.types.d.ts +1 -0
- package/dist/types/adapter.types.d.ts.map +1 -0
- package/dist/types/adapter.types.js +2 -0
- package/dist/types/adapter.types.js.map +1 -0
- package/dist/types/global.types.d.ts +1 -0
- package/dist/types/global.types.d.ts.map +1 -0
- package/dist/types/global.types.js +2 -0
- package/dist/types/global.types.js.map +1 -0
- package/dist/types/plugin.types.d.ts +1 -0
- package/dist/types/plugin.types.d.ts.map +1 -0
- package/dist/types/plugin.types.js +2 -0
- package/dist/types/plugin.types.js.map +1 -0
- package/dist/types/workflow.types.d.ts +503 -0
- package/dist/types/workflow.types.d.ts.map +1 -0
- package/dist/types/workflow.types.js +90 -0
- package/dist/types/workflow.types.js.map +1 -0
- package/dist/utils/assert.d.ts +1 -0
- package/dist/utils/assert.d.ts.map +1 -0
- package/dist/utils/assert.js +2 -0
- package/dist/utils/assert.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ecosystem Core - Workflow Schema Exports
|
|
3
|
+
*
|
|
4
|
+
* Central export point for all workflow schema definitions, validators, and types.
|
|
5
|
+
* Import from here rather than individual files for consistency.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import {
|
|
10
|
+
* OrbytWorkflowSchema,
|
|
11
|
+
* WorkflowDefinition,
|
|
12
|
+
* validateWorkflow
|
|
13
|
+
* } from '@ecosystem-core/schemas';
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import { type WorkflowDefinitionZod } from './workflow.schema.zod.js';
|
|
17
|
+
export { OrbytWorkflowSchema, ValidatedOrbytWorkflowSchema, StepSchema, MetadataSchema, AnnotationsSchema, TriggerSchema, SecretsSchema, InputsSchema, InputDefinitionSchema, ContextSchema, DefaultsSchema, PoliciesSchema, PermissionsSchema, ResourcesSchema, RetryConfigSchema, WorkflowBodySchema, type WorkflowDefinitionZod as ZodWorkflowDefinition, type ValidatedWorkflowDefinition, type StepDefinition as ZodStepDefinition, type TriggerDefinition, type MetadataDefinition, type SecretsDefinition, type InputsDefinition, type InputDefinition, type ContextDefinition, type DefaultsDefinition, type PoliciesDefinition, type PermissionsDefinition, type ResourcesDefinition, type RetryConfig, } from './workflow.schema.zod.js';
|
|
18
|
+
export { WorkflowKind, TriggerType, FailurePolicy, BackoffStrategy, SandboxLevel, ExecutionEnvironment, type WorkflowDefinition, type WorkflowMetadata, type WorkflowAnnotations, type WorkflowTrigger, type ManualTrigger, type CronTrigger, type EventTrigger, type WebhookTrigger, type WorkflowSecrets, type WorkflowInputs, type WorkflowContext, type WorkflowDefaults, type WorkflowPolicies, type WorkflowPermissions, type WorkflowResources, type WorkflowBody, type WorkflowLifecycleHooks, type WorkflowStepDefinition, type StepOutputMapping, type StepCondition, type VariableReference, type ActionReference, type SecretReference, type InputType, type TimeoutSpec, type FilesystemPermissions, type NetworkPermissions, type V1Field, type FutureField, } from '../types/workflow.types.js';
|
|
19
|
+
/**
|
|
20
|
+
* Validate a workflow definition against the Zod schema
|
|
21
|
+
*
|
|
22
|
+
* @param workflow - Raw workflow object to validate
|
|
23
|
+
* @returns Validated workflow definition
|
|
24
|
+
* @throws ZodError if validation fails
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* try {
|
|
29
|
+
* const validated = validateWorkflow(rawWorkflow);
|
|
30
|
+
* console.log('Workflow is valid');
|
|
31
|
+
* } catch (error) {
|
|
32
|
+
* console.error('Validation failed:', error.errors);
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function validateWorkflow(workflow: unknown): {
|
|
37
|
+
version: string;
|
|
38
|
+
kind: "workflow" | "pipeline" | "job" | "playbook" | "automation";
|
|
39
|
+
workflow: {
|
|
40
|
+
steps: {
|
|
41
|
+
id: string;
|
|
42
|
+
uses: string;
|
|
43
|
+
continueOnError: boolean;
|
|
44
|
+
name?: string | undefined;
|
|
45
|
+
with?: Record<string, any> | undefined;
|
|
46
|
+
when?: string | undefined;
|
|
47
|
+
needs?: string[] | undefined;
|
|
48
|
+
retry?: {
|
|
49
|
+
max: number;
|
|
50
|
+
backoff?: "linear" | "exponential" | undefined;
|
|
51
|
+
delay?: number | undefined;
|
|
52
|
+
} | undefined;
|
|
53
|
+
timeout?: string | undefined;
|
|
54
|
+
outputs?: Record<string, string> | undefined;
|
|
55
|
+
env?: Record<string, string> | undefined;
|
|
56
|
+
}[];
|
|
57
|
+
};
|
|
58
|
+
metadata?: {
|
|
59
|
+
[x: string]: unknown;
|
|
60
|
+
name?: string | undefined;
|
|
61
|
+
description?: string | undefined;
|
|
62
|
+
tags?: string[] | undefined;
|
|
63
|
+
owner?: string | undefined;
|
|
64
|
+
version?: string | undefined;
|
|
65
|
+
createdAt?: string | undefined;
|
|
66
|
+
updatedAt?: string | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
annotations?: {
|
|
69
|
+
[x: string]: unknown;
|
|
70
|
+
'ai.intent'?: string | undefined;
|
|
71
|
+
'ui.group'?: string | undefined;
|
|
72
|
+
'ui.icon'?: string | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
triggers?: ({
|
|
75
|
+
type: "manual";
|
|
76
|
+
} | {
|
|
77
|
+
type: "cron";
|
|
78
|
+
schedule: string;
|
|
79
|
+
} | {
|
|
80
|
+
type: "event";
|
|
81
|
+
source: string;
|
|
82
|
+
filters?: Record<string, any> | undefined;
|
|
83
|
+
} | {
|
|
84
|
+
type: "webhook";
|
|
85
|
+
endpoint: string;
|
|
86
|
+
filters?: Record<string, any> | undefined;
|
|
87
|
+
})[] | undefined;
|
|
88
|
+
secrets?: {
|
|
89
|
+
vault: string;
|
|
90
|
+
keys: Record<string, string>;
|
|
91
|
+
} | undefined;
|
|
92
|
+
inputs?: Record<string, {
|
|
93
|
+
required: boolean;
|
|
94
|
+
type?: "string" | "number" | "boolean" | "object" | "array" | undefined;
|
|
95
|
+
default?: any;
|
|
96
|
+
description?: string | undefined;
|
|
97
|
+
}> | undefined;
|
|
98
|
+
context?: {
|
|
99
|
+
[x: string]: unknown;
|
|
100
|
+
env?: "local" | "dev" | "staging" | "prod" | undefined;
|
|
101
|
+
platform?: string | undefined;
|
|
102
|
+
workspace?: string | undefined;
|
|
103
|
+
} | undefined;
|
|
104
|
+
defaults?: {
|
|
105
|
+
[x: string]: unknown;
|
|
106
|
+
retry?: {
|
|
107
|
+
max: number;
|
|
108
|
+
backoff?: "linear" | "exponential" | undefined;
|
|
109
|
+
delay?: number | undefined;
|
|
110
|
+
} | undefined;
|
|
111
|
+
timeout?: string | undefined;
|
|
112
|
+
adapter?: string | undefined;
|
|
113
|
+
} | undefined;
|
|
114
|
+
policies?: {
|
|
115
|
+
[x: string]: unknown;
|
|
116
|
+
failure: "stop" | "continue" | "isolate";
|
|
117
|
+
concurrency: number;
|
|
118
|
+
sandbox: "none" | "basic" | "strict";
|
|
119
|
+
} | undefined;
|
|
120
|
+
permissions?: {
|
|
121
|
+
[x: string]: unknown;
|
|
122
|
+
fs?: {
|
|
123
|
+
read?: string[] | undefined;
|
|
124
|
+
write?: string[] | undefined;
|
|
125
|
+
} | undefined;
|
|
126
|
+
network?: {
|
|
127
|
+
allow?: string[] | undefined;
|
|
128
|
+
deny?: string[] | undefined;
|
|
129
|
+
} | undefined;
|
|
130
|
+
} | undefined;
|
|
131
|
+
resources?: {
|
|
132
|
+
[x: string]: unknown;
|
|
133
|
+
cpu?: string | number | undefined;
|
|
134
|
+
memory?: string | undefined;
|
|
135
|
+
disk?: string | undefined;
|
|
136
|
+
timeout?: string | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
outputs?: Record<string, string> | undefined;
|
|
139
|
+
on?: {
|
|
140
|
+
success?: any[] | undefined;
|
|
141
|
+
failure?: any[] | undefined;
|
|
142
|
+
always?: any[] | undefined;
|
|
143
|
+
} | undefined;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Safely validate a workflow, returning success or error
|
|
147
|
+
*
|
|
148
|
+
* @param workflow - Raw workflow object to validate
|
|
149
|
+
* @returns Success result with data, or error result with issues
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* const result = safeValidateWorkflow(rawWorkflow);
|
|
154
|
+
* if (result.success) {
|
|
155
|
+
* console.log('Valid workflow:', result.data);
|
|
156
|
+
* } else {
|
|
157
|
+
* console.error('Invalid workflow:', result.error.issues);
|
|
158
|
+
* }
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export declare function safeValidateWorkflow(workflow: unknown): import("zod").ZodSafeParseResult<{
|
|
162
|
+
version: string;
|
|
163
|
+
kind: "workflow" | "pipeline" | "job" | "playbook" | "automation";
|
|
164
|
+
workflow: {
|
|
165
|
+
steps: {
|
|
166
|
+
id: string;
|
|
167
|
+
uses: string;
|
|
168
|
+
continueOnError: boolean;
|
|
169
|
+
name?: string | undefined;
|
|
170
|
+
with?: Record<string, any> | undefined;
|
|
171
|
+
when?: string | undefined;
|
|
172
|
+
needs?: string[] | undefined;
|
|
173
|
+
retry?: {
|
|
174
|
+
max: number;
|
|
175
|
+
backoff?: "linear" | "exponential" | undefined;
|
|
176
|
+
delay?: number | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
timeout?: string | undefined;
|
|
179
|
+
outputs?: Record<string, string> | undefined;
|
|
180
|
+
env?: Record<string, string> | undefined;
|
|
181
|
+
}[];
|
|
182
|
+
};
|
|
183
|
+
metadata?: {
|
|
184
|
+
[x: string]: unknown;
|
|
185
|
+
name?: string | undefined;
|
|
186
|
+
description?: string | undefined;
|
|
187
|
+
tags?: string[] | undefined;
|
|
188
|
+
owner?: string | undefined;
|
|
189
|
+
version?: string | undefined;
|
|
190
|
+
createdAt?: string | undefined;
|
|
191
|
+
updatedAt?: string | undefined;
|
|
192
|
+
} | undefined;
|
|
193
|
+
annotations?: {
|
|
194
|
+
[x: string]: unknown;
|
|
195
|
+
'ai.intent'?: string | undefined;
|
|
196
|
+
'ui.group'?: string | undefined;
|
|
197
|
+
'ui.icon'?: string | undefined;
|
|
198
|
+
} | undefined;
|
|
199
|
+
triggers?: ({
|
|
200
|
+
type: "manual";
|
|
201
|
+
} | {
|
|
202
|
+
type: "cron";
|
|
203
|
+
schedule: string;
|
|
204
|
+
} | {
|
|
205
|
+
type: "event";
|
|
206
|
+
source: string;
|
|
207
|
+
filters?: Record<string, any> | undefined;
|
|
208
|
+
} | {
|
|
209
|
+
type: "webhook";
|
|
210
|
+
endpoint: string;
|
|
211
|
+
filters?: Record<string, any> | undefined;
|
|
212
|
+
})[] | undefined;
|
|
213
|
+
secrets?: {
|
|
214
|
+
vault: string;
|
|
215
|
+
keys: Record<string, string>;
|
|
216
|
+
} | undefined;
|
|
217
|
+
inputs?: Record<string, {
|
|
218
|
+
required: boolean;
|
|
219
|
+
type?: "string" | "number" | "boolean" | "object" | "array" | undefined;
|
|
220
|
+
default?: any;
|
|
221
|
+
description?: string | undefined;
|
|
222
|
+
}> | undefined;
|
|
223
|
+
context?: {
|
|
224
|
+
[x: string]: unknown;
|
|
225
|
+
env?: "local" | "dev" | "staging" | "prod" | undefined;
|
|
226
|
+
platform?: string | undefined;
|
|
227
|
+
workspace?: string | undefined;
|
|
228
|
+
} | undefined;
|
|
229
|
+
defaults?: {
|
|
230
|
+
[x: string]: unknown;
|
|
231
|
+
retry?: {
|
|
232
|
+
max: number;
|
|
233
|
+
backoff?: "linear" | "exponential" | undefined;
|
|
234
|
+
delay?: number | undefined;
|
|
235
|
+
} | undefined;
|
|
236
|
+
timeout?: string | undefined;
|
|
237
|
+
adapter?: string | undefined;
|
|
238
|
+
} | undefined;
|
|
239
|
+
policies?: {
|
|
240
|
+
[x: string]: unknown;
|
|
241
|
+
failure: "stop" | "continue" | "isolate";
|
|
242
|
+
concurrency: number;
|
|
243
|
+
sandbox: "none" | "basic" | "strict";
|
|
244
|
+
} | undefined;
|
|
245
|
+
permissions?: {
|
|
246
|
+
[x: string]: unknown;
|
|
247
|
+
fs?: {
|
|
248
|
+
read?: string[] | undefined;
|
|
249
|
+
write?: string[] | undefined;
|
|
250
|
+
} | undefined;
|
|
251
|
+
network?: {
|
|
252
|
+
allow?: string[] | undefined;
|
|
253
|
+
deny?: string[] | undefined;
|
|
254
|
+
} | undefined;
|
|
255
|
+
} | undefined;
|
|
256
|
+
resources?: {
|
|
257
|
+
[x: string]: unknown;
|
|
258
|
+
cpu?: string | number | undefined;
|
|
259
|
+
memory?: string | undefined;
|
|
260
|
+
disk?: string | undefined;
|
|
261
|
+
timeout?: string | undefined;
|
|
262
|
+
} | undefined;
|
|
263
|
+
outputs?: Record<string, string> | undefined;
|
|
264
|
+
on?: {
|
|
265
|
+
success?: any[] | undefined;
|
|
266
|
+
failure?: any[] | undefined;
|
|
267
|
+
always?: any[] | undefined;
|
|
268
|
+
} | undefined;
|
|
269
|
+
}>;
|
|
270
|
+
/**
|
|
271
|
+
* Validate just the structure (without refinements)
|
|
272
|
+
* Faster validation for initial checks
|
|
273
|
+
*/
|
|
274
|
+
export declare function validateWorkflowStructure(workflow: unknown): {
|
|
275
|
+
version: string;
|
|
276
|
+
kind: "workflow" | "pipeline" | "job" | "playbook" | "automation";
|
|
277
|
+
workflow: {
|
|
278
|
+
steps: {
|
|
279
|
+
id: string;
|
|
280
|
+
uses: string;
|
|
281
|
+
continueOnError: boolean;
|
|
282
|
+
name?: string | undefined;
|
|
283
|
+
with?: Record<string, any> | undefined;
|
|
284
|
+
when?: string | undefined;
|
|
285
|
+
needs?: string[] | undefined;
|
|
286
|
+
retry?: {
|
|
287
|
+
max: number;
|
|
288
|
+
backoff?: "linear" | "exponential" | undefined;
|
|
289
|
+
delay?: number | undefined;
|
|
290
|
+
} | undefined;
|
|
291
|
+
timeout?: string | undefined;
|
|
292
|
+
outputs?: Record<string, string> | undefined;
|
|
293
|
+
env?: Record<string, string> | undefined;
|
|
294
|
+
}[];
|
|
295
|
+
};
|
|
296
|
+
metadata?: {
|
|
297
|
+
[x: string]: unknown;
|
|
298
|
+
name?: string | undefined;
|
|
299
|
+
description?: string | undefined;
|
|
300
|
+
tags?: string[] | undefined;
|
|
301
|
+
owner?: string | undefined;
|
|
302
|
+
version?: string | undefined;
|
|
303
|
+
createdAt?: string | undefined;
|
|
304
|
+
updatedAt?: string | undefined;
|
|
305
|
+
} | undefined;
|
|
306
|
+
annotations?: {
|
|
307
|
+
[x: string]: unknown;
|
|
308
|
+
'ai.intent'?: string | undefined;
|
|
309
|
+
'ui.group'?: string | undefined;
|
|
310
|
+
'ui.icon'?: string | undefined;
|
|
311
|
+
} | undefined;
|
|
312
|
+
triggers?: ({
|
|
313
|
+
type: "manual";
|
|
314
|
+
} | {
|
|
315
|
+
type: "cron";
|
|
316
|
+
schedule: string;
|
|
317
|
+
} | {
|
|
318
|
+
type: "event";
|
|
319
|
+
source: string;
|
|
320
|
+
filters?: Record<string, any> | undefined;
|
|
321
|
+
} | {
|
|
322
|
+
type: "webhook";
|
|
323
|
+
endpoint: string;
|
|
324
|
+
filters?: Record<string, any> | undefined;
|
|
325
|
+
})[] | undefined;
|
|
326
|
+
secrets?: {
|
|
327
|
+
vault: string;
|
|
328
|
+
keys: Record<string, string>;
|
|
329
|
+
} | undefined;
|
|
330
|
+
inputs?: Record<string, {
|
|
331
|
+
required: boolean;
|
|
332
|
+
type?: "string" | "number" | "boolean" | "object" | "array" | undefined;
|
|
333
|
+
default?: any;
|
|
334
|
+
description?: string | undefined;
|
|
335
|
+
}> | undefined;
|
|
336
|
+
context?: {
|
|
337
|
+
[x: string]: unknown;
|
|
338
|
+
env?: "local" | "dev" | "staging" | "prod" | undefined;
|
|
339
|
+
platform?: string | undefined;
|
|
340
|
+
workspace?: string | undefined;
|
|
341
|
+
} | undefined;
|
|
342
|
+
defaults?: {
|
|
343
|
+
[x: string]: unknown;
|
|
344
|
+
retry?: {
|
|
345
|
+
max: number;
|
|
346
|
+
backoff?: "linear" | "exponential" | undefined;
|
|
347
|
+
delay?: number | undefined;
|
|
348
|
+
} | undefined;
|
|
349
|
+
timeout?: string | undefined;
|
|
350
|
+
adapter?: string | undefined;
|
|
351
|
+
} | undefined;
|
|
352
|
+
policies?: {
|
|
353
|
+
[x: string]: unknown;
|
|
354
|
+
failure: "stop" | "continue" | "isolate";
|
|
355
|
+
concurrency: number;
|
|
356
|
+
sandbox: "none" | "basic" | "strict";
|
|
357
|
+
} | undefined;
|
|
358
|
+
permissions?: {
|
|
359
|
+
[x: string]: unknown;
|
|
360
|
+
fs?: {
|
|
361
|
+
read?: string[] | undefined;
|
|
362
|
+
write?: string[] | undefined;
|
|
363
|
+
} | undefined;
|
|
364
|
+
network?: {
|
|
365
|
+
allow?: string[] | undefined;
|
|
366
|
+
deny?: string[] | undefined;
|
|
367
|
+
} | undefined;
|
|
368
|
+
} | undefined;
|
|
369
|
+
resources?: {
|
|
370
|
+
[x: string]: unknown;
|
|
371
|
+
cpu?: string | number | undefined;
|
|
372
|
+
memory?: string | undefined;
|
|
373
|
+
disk?: string | undefined;
|
|
374
|
+
timeout?: string | undefined;
|
|
375
|
+
} | undefined;
|
|
376
|
+
outputs?: Record<string, string> | undefined;
|
|
377
|
+
on?: {
|
|
378
|
+
success?: any[] | undefined;
|
|
379
|
+
failure?: any[] | undefined;
|
|
380
|
+
always?: any[] | undefined;
|
|
381
|
+
} | undefined;
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Check if an object matches the workflow shape without throwing
|
|
385
|
+
*/
|
|
386
|
+
export declare function isWorkflowDefinition(obj: unknown): obj is WorkflowDefinitionZod;
|
|
387
|
+
/**
|
|
388
|
+
* Path to the JSON Schema file for tooling integration
|
|
389
|
+
* Use this for:
|
|
390
|
+
* - IDE autocomplete
|
|
391
|
+
* - Documentation generation
|
|
392
|
+
* - External validators
|
|
393
|
+
* - OpenAPI/Swagger specs
|
|
394
|
+
*/
|
|
395
|
+
export declare const WORKFLOW_JSON_SCHEMA_PATH: string;
|
|
396
|
+
/**
|
|
397
|
+
* Get the JSON Schema as an object
|
|
398
|
+
* Useful for embedding in other schemas or tools
|
|
399
|
+
*/
|
|
400
|
+
export declare function getWorkflowJsonSchema(): Promise<object>;
|
|
401
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAEL,mBAAmB,EACnB,4BAA4B,EAG5B,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,e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;;;;;;;;;;;;;;EAEjD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAErD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,qBAAqB,CAE/E;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAA8D,CAAC;AAErG;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,CAI7D"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ecosystem Core - Workflow Schema Exports
|
|
3
|
+
*
|
|
4
|
+
* Central export point for all workflow schema definitions, validators, and types.
|
|
5
|
+
* Import from here rather than individual files for consistency.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import {
|
|
10
|
+
* OrbytWorkflowSchema,
|
|
11
|
+
* WorkflowDefinition,
|
|
12
|
+
* validateWorkflow
|
|
13
|
+
* } from '@ecosystem-core/schemas';
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import { OrbytWorkflowSchema, ValidatedOrbytWorkflowSchema, } from './workflow.schema.zod.js';
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// ZOD SCHEMAS - Runtime Validation
|
|
19
|
+
// ============================================================================
|
|
20
|
+
export {
|
|
21
|
+
// Main Schema
|
|
22
|
+
OrbytWorkflowSchema, ValidatedOrbytWorkflowSchema,
|
|
23
|
+
// Sub-schemas
|
|
24
|
+
StepSchema, MetadataSchema, AnnotationsSchema, TriggerSchema, SecretsSchema, InputsSchema, InputDefinitionSchema, ContextSchema, DefaultsSchema, PoliciesSchema, PermissionsSchema, ResourcesSchema, RetryConfigSchema, WorkflowBodySchema, } from './workflow.schema.zod.js';
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// TYPESCRIPT TYPES - Type Definitions
|
|
27
|
+
// ============================================================================
|
|
28
|
+
export {
|
|
29
|
+
// Enums
|
|
30
|
+
WorkflowKind, TriggerType, FailurePolicy, BackoffStrategy, SandboxLevel, ExecutionEnvironment, } from '../types/workflow.types.js';
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// VALIDATION HELPERS
|
|
33
|
+
// ============================================================================
|
|
34
|
+
/**
|
|
35
|
+
* Validate a workflow definition against the Zod schema
|
|
36
|
+
*
|
|
37
|
+
* @param workflow - Raw workflow object to validate
|
|
38
|
+
* @returns Validated workflow definition
|
|
39
|
+
* @throws ZodError if validation fails
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* try {
|
|
44
|
+
* const validated = validateWorkflow(rawWorkflow);
|
|
45
|
+
* console.log('Workflow is valid');
|
|
46
|
+
* } catch (error) {
|
|
47
|
+
* console.error('Validation failed:', error.errors);
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export function validateWorkflow(workflow) {
|
|
52
|
+
return ValidatedOrbytWorkflowSchema.parse(workflow);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Safely validate a workflow, returning success or error
|
|
56
|
+
*
|
|
57
|
+
* @param workflow - Raw workflow object to validate
|
|
58
|
+
* @returns Success result with data, or error result with issues
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* const result = safeValidateWorkflow(rawWorkflow);
|
|
63
|
+
* if (result.success) {
|
|
64
|
+
* console.log('Valid workflow:', result.data);
|
|
65
|
+
* } else {
|
|
66
|
+
* console.error('Invalid workflow:', result.error.issues);
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export function safeValidateWorkflow(workflow) {
|
|
71
|
+
return ValidatedOrbytWorkflowSchema.safeParse(workflow);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Validate just the structure (without refinements)
|
|
75
|
+
* Faster validation for initial checks
|
|
76
|
+
*/
|
|
77
|
+
export function validateWorkflowStructure(workflow) {
|
|
78
|
+
return OrbytWorkflowSchema.parse(workflow);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Check if an object matches the workflow shape without throwing
|
|
82
|
+
*/
|
|
83
|
+
export function isWorkflowDefinition(obj) {
|
|
84
|
+
return OrbytWorkflowSchema.safeParse(obj).success;
|
|
85
|
+
}
|
|
86
|
+
// ============================================================================
|
|
87
|
+
// JSON SCHEMA PATH
|
|
88
|
+
// ============================================================================
|
|
89
|
+
/**
|
|
90
|
+
* Path to the JSON Schema file for tooling integration
|
|
91
|
+
* Use this for:
|
|
92
|
+
* - IDE autocomplete
|
|
93
|
+
* - Documentation generation
|
|
94
|
+
* - External validators
|
|
95
|
+
* - OpenAPI/Swagger specs
|
|
96
|
+
*/
|
|
97
|
+
export const WORKFLOW_JSON_SCHEMA_PATH = new URL('./workflow.schema.json', import.meta.url).pathname;
|
|
98
|
+
/**
|
|
99
|
+
* Get the JSON Schema as an object
|
|
100
|
+
* Useful for embedding in other schemas or tools
|
|
101
|
+
*/
|
|
102
|
+
export async function getWorkflowJsonSchema() {
|
|
103
|
+
const fs = await import('fs/promises');
|
|
104
|
+
const content = await fs.readFile(WORKFLOW_JSON_SCHEMA_PATH, 'utf-8');
|
|
105
|
+
return JSON.parse(content);
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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