@usearazzo/runner 1.0.1-alpha.25 → 1.0.1-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/arazzo-runner.browser.js +8 -3
- package/dist/arazzo-runner.browser.min.js +1 -1
- package/package.json +4 -4
- package/src/document/ArazzoDocument.cjs +3 -2
- package/src/document/ArazzoDocument.mjs +3 -2
- package/src/registry/providers/ArazzoDocumentRegistryProvider.cjs +3 -1
- package/src/registry/providers/ArazzoDocumentRegistryProvider.mjs +3 -1
- package/src/registry/providers/OpenAPIDocumentRegistryProvider.cjs +2 -0
- package/src/registry/providers/OpenAPIDocumentRegistryProvider.mjs +2 -0
- package/types/runner.d.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usearazzo/runner",
|
|
3
|
-
"version": "1.0.1-alpha.
|
|
3
|
+
"version": "1.0.1-alpha.26",
|
|
4
4
|
"description": "Runner for Arazzo Workflows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arazzo",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"@swaggerexpert/json-pointer": "^3.0.2",
|
|
74
74
|
"@swaggerexpert/jsonpath": "^4.0.5",
|
|
75
75
|
"@swaggerexpert/media-types": "^1.0.2",
|
|
76
|
-
"@usearazzo/parser": "1.0.1-alpha.
|
|
77
|
-
"@usearazzo/resolver": "1.0.1-alpha.
|
|
76
|
+
"@usearazzo/parser": "1.0.1-alpha.26",
|
|
77
|
+
"@usearazzo/resolver": "1.0.1-alpha.26",
|
|
78
78
|
"@xmldom/xmldom": "^0.9.12",
|
|
79
79
|
"fontoxpath": "^3.34.0",
|
|
80
80
|
"ramda": "^0.32.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"swagger-client": "^3.38.4"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "8bacf6bf0e5d1e4c44a81583c5f1719bbbefaf97"
|
|
98
98
|
}
|
|
@@ -56,8 +56,9 @@ class ArazzoDocument extends _APIDocument.default {
|
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* The workflows of this document that can be addressed by `workflowId`, in
|
|
59
|
-
* document order.
|
|
60
|
-
*
|
|
59
|
+
* document order. A duplicated `workflowId` is listed once, for its first
|
|
60
|
+
* workflow. Reads this document only: source descriptions are neither loaded
|
|
61
|
+
* nor listed.
|
|
61
62
|
*/
|
|
62
63
|
listWorkflows() {
|
|
63
64
|
return [...this.workflowIndex].map(([workflowId, jsonPointer]) => {
|
|
@@ -48,8 +48,9 @@ class ArazzoDocument extends APIDocument {
|
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* The workflows of this document that can be addressed by `workflowId`, in
|
|
51
|
-
* document order.
|
|
52
|
-
*
|
|
51
|
+
* document order. A duplicated `workflowId` is listed once, for its first
|
|
52
|
+
* workflow. Reads this document only: source descriptions are neither loaded
|
|
53
|
+
* nor listed.
|
|
53
54
|
*/
|
|
54
55
|
listWorkflows() {
|
|
55
56
|
return [...this.workflowIndex].map(([workflowId, jsonPointer]) => {
|
|
@@ -99,7 +99,8 @@ class ArazzoDocumentRegistryProvider extends _DocumentRegistryProvider.default {
|
|
|
99
99
|
* A source description's canonical URI is resolved here too — against the
|
|
100
100
|
* document's base URI, into the exact form the document registry keys on —
|
|
101
101
|
* so every consumer works with a ready-to-use, non-relative URI. The first
|
|
102
|
-
* element of a duplicated source description name wins
|
|
102
|
+
* element of a duplicated source description name wins, and so does the
|
|
103
|
+
* first workflow of a duplicated workflowId.
|
|
103
104
|
*/
|
|
104
105
|
#buildIndexes(uri, parseResult) {
|
|
105
106
|
const workflowIndex = new _ArazzoWorkflowIndex.default();
|
|
@@ -111,6 +112,7 @@ class ArazzoDocumentRegistryProvider extends _DocumentRegistryProvider.default {
|
|
|
111
112
|
const workflowId = (0, _apidomCore.toValue)(workflow.workflowId);
|
|
112
113
|
if (typeof workflowId !== 'string') return path.skip();
|
|
113
114
|
if (workflowId === '') return path.skip();
|
|
115
|
+
if (workflowIndex.has(workflowId)) return path.skip();
|
|
114
116
|
const workflowPointer = path.formatPath('jsonpointer');
|
|
115
117
|
workflowIndex.set(workflowId, workflowPointer);
|
|
116
118
|
|
|
@@ -91,7 +91,8 @@ class ArazzoDocumentRegistryProvider extends DocumentRegistryProvider {
|
|
|
91
91
|
* A source description's canonical URI is resolved here too — against the
|
|
92
92
|
* document's base URI, into the exact form the document registry keys on —
|
|
93
93
|
* so every consumer works with a ready-to-use, non-relative URI. The first
|
|
94
|
-
* element of a duplicated source description name wins
|
|
94
|
+
* element of a duplicated source description name wins, and so does the
|
|
95
|
+
* first workflow of a duplicated workflowId.
|
|
95
96
|
*/
|
|
96
97
|
#buildIndexes(uri, parseResult) {
|
|
97
98
|
const workflowIndex = new ArazzoWorkflowIndex();
|
|
@@ -103,6 +104,7 @@ class ArazzoDocumentRegistryProvider extends DocumentRegistryProvider {
|
|
|
103
104
|
const workflowId = toValue(workflow.workflowId);
|
|
104
105
|
if (typeof workflowId !== 'string') return path.skip();
|
|
105
106
|
if (workflowId === '') return path.skip();
|
|
107
|
+
if (workflowIndex.has(workflowId)) return path.skip();
|
|
106
108
|
const workflowPointer = path.formatPath('jsonpointer');
|
|
107
109
|
workflowIndex.set(workflowId, workflowPointer);
|
|
108
110
|
|
|
@@ -44,6 +44,7 @@ const providerOptionsOverride = exports.providerOptionsOverride = {
|
|
|
44
44
|
* Provides OpenAPIDocument instances for the DocumentRegistry.
|
|
45
45
|
*
|
|
46
46
|
* Parses, dereferences, and builds an OperationIndex for OpenAPI documents.
|
|
47
|
+
* The first operation of a duplicated operationId wins.
|
|
47
48
|
* @public
|
|
48
49
|
*/
|
|
49
50
|
class OpenAPIDocumentRegistryProvider extends _DocumentRegistryProvider.default {
|
|
@@ -95,6 +96,7 @@ class OpenAPIDocumentRegistryProvider extends _DocumentRegistryProvider.default
|
|
|
95
96
|
const operationId = (0, _apidomCore.toValue)(operation.operationId);
|
|
96
97
|
if (typeof operationId !== 'string') return path.skip();
|
|
97
98
|
if (operationId === '') return path.skip();
|
|
99
|
+
if (index.has(operationId)) return path.skip();
|
|
98
100
|
index.set(operationId, path.formatPath('jsonpointer'));
|
|
99
101
|
path.skip();
|
|
100
102
|
}
|
|
@@ -36,6 +36,7 @@ export const providerOptionsOverride = {
|
|
|
36
36
|
* Provides OpenAPIDocument instances for the DocumentRegistry.
|
|
37
37
|
*
|
|
38
38
|
* Parses, dereferences, and builds an OperationIndex for OpenAPI documents.
|
|
39
|
+
* The first operation of a duplicated operationId wins.
|
|
39
40
|
* @public
|
|
40
41
|
*/
|
|
41
42
|
class OpenAPIDocumentRegistryProvider extends DocumentRegistryProvider {
|
|
@@ -87,6 +88,7 @@ class OpenAPIDocumentRegistryProvider extends DocumentRegistryProvider {
|
|
|
87
88
|
const operationId = toValue(operation.operationId);
|
|
88
89
|
if (typeof operationId !== 'string') return path.skip();
|
|
89
90
|
if (operationId === '') return path.skip();
|
|
91
|
+
if (index.has(operationId)) return path.skip();
|
|
90
92
|
index.set(operationId, path.formatPath('jsonpointer'));
|
|
91
93
|
path.skip();
|
|
92
94
|
}
|
package/types/runner.d.ts
CHANGED
|
@@ -125,8 +125,9 @@ export declare class ArazzoDocument extends APIDocument {
|
|
|
125
125
|
static is(doc: APIDocument): doc is ArazzoDocument;
|
|
126
126
|
/**
|
|
127
127
|
* The workflows of this document that can be addressed by `workflowId`, in
|
|
128
|
-
* document order.
|
|
129
|
-
*
|
|
128
|
+
* document order. A duplicated `workflowId` is listed once, for its first
|
|
129
|
+
* workflow. Reads this document only: source descriptions are neither loaded
|
|
130
|
+
* nor listed.
|
|
130
131
|
*/
|
|
131
132
|
listWorkflows(): WorkflowDescriptor[];
|
|
132
133
|
/**
|
|
@@ -1085,6 +1086,7 @@ export declare interface OpenAPIDocumentAssemblerOptions {
|
|
|
1085
1086
|
* Provides OpenAPIDocument instances for the DocumentRegistry.
|
|
1086
1087
|
*
|
|
1087
1088
|
* Parses, dereferences, and builds an OperationIndex for OpenAPI documents.
|
|
1089
|
+
* The first operation of a duplicated operationId wins.
|
|
1088
1090
|
* @public
|
|
1089
1091
|
*/
|
|
1090
1092
|
export declare class OpenAPIDocumentRegistryProvider extends DocumentRegistryProvider {
|