@jentic/arazzo-ui 1.0.0-alpha.13
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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +191 -0
- package/dist/arazzo-ui-standalone.js +4157 -0
- package/dist/arazzo-ui-standalone.mjs +5645 -0
- package/dist/arazzo-ui.css +1 -0
- package/dist/arazzo-ui.js +4157 -0
- package/dist/arazzo-ui.mjs +5390 -0
- package/package.json +92 -0
- package/types/arazzo-ui-standalone.d.ts +337 -0
- package/types/arazzo-ui.d.ts +335 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { Edge } from 'reactflow';
|
|
2
|
+
import { Node as Node_2 } from 'reactflow';
|
|
3
|
+
import { default as React_2 } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Arazzo Specification v1.0.1 Type Definitions
|
|
7
|
+
* Based on: https://spec.openapis.org/arazzo/latest.html
|
|
8
|
+
*/
|
|
9
|
+
/** @public */
|
|
10
|
+
export declare interface ArazzoDocument {
|
|
11
|
+
arazzo: string;
|
|
12
|
+
info: InfoObject;
|
|
13
|
+
sourceDescriptions: SourceDescription[];
|
|
14
|
+
workflows: Workflow[];
|
|
15
|
+
components?: ComponentsObject;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** @public */
|
|
19
|
+
export declare type ArazzoEdge = Edge<ArazzoEdgeData>;
|
|
20
|
+
|
|
21
|
+
/** @public */
|
|
22
|
+
export declare type ArazzoEdgeData = SequentialEdgeData | SuccessEdgeData | FailureEdgeData | RetryEdgeData | BundledSuccessEdgeData | BundledFailureEdgeData | BundledRetryEdgeData;
|
|
23
|
+
|
|
24
|
+
/** @public */
|
|
25
|
+
export declare type ArazzoNode = Node_2<ArazzoNodeData>;
|
|
26
|
+
|
|
27
|
+
/** @public */
|
|
28
|
+
export declare type ArazzoNodeData = StepNodeData | WorkflowRefNodeData | StartNodeData | EndNodeData | WorkflowNodeData | ExternalWorkflowNodeData;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ArazzoUI - Interactive viewer for Arazzo workflow specifications
|
|
32
|
+
*
|
|
33
|
+
* Renders diagram and documentation views of an Arazzo document.
|
|
34
|
+
* Supports click-to-select, workflow switching, zoom/pan.
|
|
35
|
+
* No document mutation capability.
|
|
36
|
+
*
|
|
37
|
+
* The `document` prop accepts:
|
|
38
|
+
* - An `ArazzoDocument` object (rendered immediately)
|
|
39
|
+
* - A JSON or YAML string (parsed via \@jentic/arazzo-parser)
|
|
40
|
+
* - A file path or HTTP(S) URL (fetched and parsed via \@jentic/arazzo-parser)
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare const ArazzoUI: React_2.ForwardRefExoticComponent<ArazzoUIProps & React_2.RefAttributes<ArazzoUIRef>>;
|
|
45
|
+
|
|
46
|
+
/** @public */
|
|
47
|
+
export declare interface ArazzoUIProps {
|
|
48
|
+
document: ArazzoDocument | string;
|
|
49
|
+
view?: ViewerMode;
|
|
50
|
+
activeWorkflowId?: string | null;
|
|
51
|
+
selectedNodeId?: string | null;
|
|
52
|
+
diagramType?: DiagramType | 'none';
|
|
53
|
+
className?: string;
|
|
54
|
+
style?: React.CSSProperties;
|
|
55
|
+
onNodeSelect?: (nodeId: string, node: ArazzoNode) => void;
|
|
56
|
+
onEdgeSelect?: (edgeId: string, edge: ArazzoEdge) => void;
|
|
57
|
+
onWorkflowSelect?: (workflowId: string) => void;
|
|
58
|
+
onViewChange?: (view: ViewerMode) => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** @public */
|
|
62
|
+
export declare interface ArazzoUIRef {
|
|
63
|
+
fitView(): void;
|
|
64
|
+
setZoom(level: number): void;
|
|
65
|
+
getDocument(): ArazzoDocument;
|
|
66
|
+
setActiveWorkflow(workflowId: string | null): void;
|
|
67
|
+
selectStep(stepId: string): void;
|
|
68
|
+
clearSelection(): void;
|
|
69
|
+
getActiveWorkflowId(): string | null;
|
|
70
|
+
getSelectedStepId(): string | null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** @public */
|
|
74
|
+
export declare interface BundledFailureEdgeData {
|
|
75
|
+
type: 'bundled-failure';
|
|
76
|
+
action: FailureAction;
|
|
77
|
+
criteria?: Criterion[];
|
|
78
|
+
sources: Array<{
|
|
79
|
+
nodeId: string;
|
|
80
|
+
handleId: string;
|
|
81
|
+
}>;
|
|
82
|
+
actionIdx: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** @public */
|
|
86
|
+
export declare interface BundledRetryEdgeData {
|
|
87
|
+
type: 'bundled-retry';
|
|
88
|
+
action: FailureAction;
|
|
89
|
+
retryAfter?: number;
|
|
90
|
+
retryLimit?: number;
|
|
91
|
+
criteria?: Criterion[];
|
|
92
|
+
sources: Array<{
|
|
93
|
+
nodeId: string;
|
|
94
|
+
handleId: string;
|
|
95
|
+
}>;
|
|
96
|
+
actionIdx: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @public */
|
|
100
|
+
export declare interface BundledSuccessEdgeData {
|
|
101
|
+
type: 'bundled-success';
|
|
102
|
+
action: SuccessAction;
|
|
103
|
+
criteria?: Criterion[];
|
|
104
|
+
sources: Array<{
|
|
105
|
+
nodeId: string;
|
|
106
|
+
handleId: string;
|
|
107
|
+
}>;
|
|
108
|
+
actionIdx: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @public */
|
|
112
|
+
export declare interface ComponentsObject {
|
|
113
|
+
inputs?: Record<string, JSONSchema>;
|
|
114
|
+
parameters?: Record<string, Parameter>;
|
|
115
|
+
successActions?: Record<string, SuccessAction>;
|
|
116
|
+
failureActions?: Record<string, FailureAction>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** @public */
|
|
120
|
+
export declare interface Criterion {
|
|
121
|
+
context?: string;
|
|
122
|
+
condition: string;
|
|
123
|
+
type?: 'simple' | 'regex' | 'jsonpath' | 'xpath' | CriterionExpressionType;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** @public */
|
|
127
|
+
export declare interface CriterionExpressionType {
|
|
128
|
+
type: 'jsonpath' | 'xpath';
|
|
129
|
+
version: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** @public */
|
|
133
|
+
export declare type DiagramType = 'sequence' | 'flowchart';
|
|
134
|
+
|
|
135
|
+
/** @public */
|
|
136
|
+
export declare interface EndNodeData {
|
|
137
|
+
type: 'end';
|
|
138
|
+
workflowId: string;
|
|
139
|
+
outputs?: Record<string, string>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** @public */
|
|
143
|
+
export declare interface ExternalWorkflowNodeData {
|
|
144
|
+
type: 'externalWorkflow';
|
|
145
|
+
workflowId: string;
|
|
146
|
+
workflow?: Workflow;
|
|
147
|
+
onClick?: (workflowId: string) => void;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** @public */
|
|
151
|
+
export declare interface FailureAction {
|
|
152
|
+
name: string;
|
|
153
|
+
type: 'end' | 'retry' | 'goto';
|
|
154
|
+
workflowId?: string;
|
|
155
|
+
stepId?: string;
|
|
156
|
+
retryAfter?: number;
|
|
157
|
+
retryLimit?: number;
|
|
158
|
+
criteria?: Criterion[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** @public */
|
|
162
|
+
export declare interface FailureEdgeData {
|
|
163
|
+
type: 'failure';
|
|
164
|
+
action: FailureAction;
|
|
165
|
+
criteria?: Criterion[];
|
|
166
|
+
isInherited?: boolean;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** @public */
|
|
170
|
+
export declare interface InfoObject {
|
|
171
|
+
title: string;
|
|
172
|
+
version: string;
|
|
173
|
+
summary?: string;
|
|
174
|
+
description?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** @public */
|
|
178
|
+
export declare type JSONSchema = Record<string, any>;
|
|
179
|
+
|
|
180
|
+
/** @public */
|
|
181
|
+
export declare interface Parameter {
|
|
182
|
+
name: string;
|
|
183
|
+
in?: 'path' | 'query' | 'header' | 'cookie';
|
|
184
|
+
value: any;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** @public */
|
|
188
|
+
export declare interface PayloadReplacement {
|
|
189
|
+
target: string;
|
|
190
|
+
value: any;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** @public */
|
|
194
|
+
export declare interface RequestBody {
|
|
195
|
+
contentType?: string;
|
|
196
|
+
payload?: any;
|
|
197
|
+
replacements?: PayloadReplacement[];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** @public */
|
|
201
|
+
export declare interface RetryEdgeData {
|
|
202
|
+
type: 'retry';
|
|
203
|
+
action: FailureAction;
|
|
204
|
+
retryAfter?: number;
|
|
205
|
+
retryLimit?: number;
|
|
206
|
+
criteria?: Criterion[];
|
|
207
|
+
isInherited?: boolean;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** @public */
|
|
211
|
+
export declare interface ReusableObject {
|
|
212
|
+
reference: string;
|
|
213
|
+
value?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** @public */
|
|
217
|
+
export declare interface SequentialEdgeData {
|
|
218
|
+
type: 'sequential';
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** @public */
|
|
222
|
+
export declare interface SourceDescription {
|
|
223
|
+
name: string;
|
|
224
|
+
url: string;
|
|
225
|
+
type?: 'openapi' | 'arazzo';
|
|
226
|
+
/** Internal tracking ID - not part of Arazzo spec, stripped on export */
|
|
227
|
+
_internalId?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** @public */
|
|
231
|
+
export declare interface StartNodeData {
|
|
232
|
+
type: 'start';
|
|
233
|
+
workflowId: string;
|
|
234
|
+
inputs?: JSONSchema;
|
|
235
|
+
description?: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** @public */
|
|
239
|
+
export declare interface Step {
|
|
240
|
+
stepId: string;
|
|
241
|
+
description?: string;
|
|
242
|
+
operationId?: string;
|
|
243
|
+
operationPath?: string;
|
|
244
|
+
workflowId?: string;
|
|
245
|
+
parameters?: (Parameter | ReusableObject)[];
|
|
246
|
+
requestBody?: RequestBody;
|
|
247
|
+
successCriteria?: Criterion[];
|
|
248
|
+
onSuccess?: (SuccessAction | ReusableObject)[];
|
|
249
|
+
onFailure?: (FailureAction | ReusableObject)[];
|
|
250
|
+
outputs?: Record<string, string>;
|
|
251
|
+
/** Internal tracking ID - not part of Arazzo spec, stripped on export */
|
|
252
|
+
_internalId?: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** @public */
|
|
256
|
+
export declare interface StepNodeData {
|
|
257
|
+
type: 'step';
|
|
258
|
+
step: Step;
|
|
259
|
+
workflowId: string;
|
|
260
|
+
workflowSuccessActions?: (SuccessAction | {
|
|
261
|
+
$ref: string;
|
|
262
|
+
})[];
|
|
263
|
+
workflowFailureActions?: (FailureAction | {
|
|
264
|
+
$ref: string;
|
|
265
|
+
})[];
|
|
266
|
+
isValid: boolean;
|
|
267
|
+
errors?: ValidationError[];
|
|
268
|
+
isSelected?: boolean;
|
|
269
|
+
isHighlighted?: boolean;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** @public */
|
|
273
|
+
export declare interface SuccessAction {
|
|
274
|
+
name: string;
|
|
275
|
+
type: 'end' | 'goto';
|
|
276
|
+
workflowId?: string;
|
|
277
|
+
stepId?: string;
|
|
278
|
+
criteria?: Criterion[];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** @public */
|
|
282
|
+
export declare interface SuccessEdgeData {
|
|
283
|
+
type: 'success';
|
|
284
|
+
action: SuccessAction;
|
|
285
|
+
criteria?: Criterion[];
|
|
286
|
+
isInherited?: boolean;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** @public */
|
|
290
|
+
export declare interface ValidationError {
|
|
291
|
+
path: string;
|
|
292
|
+
message: string;
|
|
293
|
+
severity: 'error' | 'warning';
|
|
294
|
+
nodeId?: string;
|
|
295
|
+
edgeId?: string;
|
|
296
|
+
specRef?: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** @public */
|
|
300
|
+
export declare type ViewerMode = 'diagram' | 'docs' | 'split';
|
|
301
|
+
|
|
302
|
+
/** @public */
|
|
303
|
+
export declare interface Workflow {
|
|
304
|
+
workflowId: string;
|
|
305
|
+
summary?: string;
|
|
306
|
+
description?: string;
|
|
307
|
+
inputs?: JSONSchema;
|
|
308
|
+
dependsOn?: string[];
|
|
309
|
+
steps: Step[];
|
|
310
|
+
successActions?: (SuccessAction | ReusableObject)[];
|
|
311
|
+
failureActions?: (FailureAction | ReusableObject)[];
|
|
312
|
+
outputs?: Record<string, string>;
|
|
313
|
+
parameters?: (Parameter | ReusableObject)[];
|
|
314
|
+
/** Internal tracking ID - not part of Arazzo spec, stripped on export */
|
|
315
|
+
_internalId?: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** @public */
|
|
319
|
+
export declare interface WorkflowNodeData {
|
|
320
|
+
type: 'workflow';
|
|
321
|
+
workflow: Workflow;
|
|
322
|
+
onClick?: (workflowId: string) => void;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/** @public */
|
|
326
|
+
export declare interface WorkflowRefNodeData {
|
|
327
|
+
type: 'workflowRef';
|
|
328
|
+
step: Step;
|
|
329
|
+
targetWorkflowId: string;
|
|
330
|
+
workflowSuccessActions?: (SuccessAction | ReusableObject)[];
|
|
331
|
+
workflowFailureActions?: (FailureAction | ReusableObject)[];
|
|
332
|
+
isValid: boolean;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export { }
|