@usearazzo/runner 1.0.1-alpha.33 → 1.0.1-alpha.34
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 +8 -0
- package/README.md +10 -1
- package/dist/arazzo-runner.browser.js +1112 -231
- package/dist/arazzo-runner.browser.min.js +1 -1
- package/package.json +16 -15
- package/src/ArazzoRunner.cjs +26 -3
- package/src/ArazzoRunner.mjs +26 -3
- package/src/client/OpenAPIOperationResponse.cjs +9 -0
- package/src/client/OpenAPIOperationResponse.mjs +9 -0
- package/src/document/APIDocument.cjs +53 -0
- package/src/document/APIDocument.mjs +53 -0
- package/src/executor/OpenAPIOperationExecutor.cjs +66 -6
- package/src/executor/OpenAPIOperationExecutor.mjs +66 -6
- package/src/executor/StepExecutor.cjs +16 -2
- package/src/executor/StepExecutor.mjs +16 -2
- package/src/executor/StepRetryRunner.cjs +5 -3
- package/src/executor/StepRetryRunner.mjs +5 -3
- package/src/executor/StepTransitionInterpreter.cjs +1 -1
- package/src/executor/StepTransitionInterpreter.mjs +1 -1
- package/src/executor/WorkflowCallStack.cjs +1 -1
- package/src/executor/WorkflowCallStack.mjs +1 -1
- package/src/executor/WorkflowExecutor.cjs +269 -53
- package/src/executor/WorkflowExecutor.mjs +269 -53
- package/src/index.cjs +7 -0
- package/src/index.mjs +2 -0
- package/src/observability/ArazzoRunnerEvent.cjs +5 -0
- package/src/observability/ArazzoRunnerEvent.mjs +1 -0
- package/src/observability/DocumentRegistryEvent.cjs +5 -0
- package/src/observability/DocumentRegistryEvent.mjs +1 -0
- package/src/observability/EventChannel.cjs +96 -0
- package/src/observability/EventChannel.mjs +91 -0
- package/src/observability/OpenAPIOperationEvent.cjs +5 -0
- package/src/observability/OpenAPIOperationEvent.mjs +1 -0
- package/src/observability/Redactor.cjs +213 -0
- package/src/observability/Redactor.mjs +208 -0
- package/src/observability/WorkflowExecutionEvent.cjs +5 -0
- package/src/observability/WorkflowExecutionEvent.mjs +1 -0
- package/src/registry/DocumentRegistry.cjs +22 -3
- package/src/registry/DocumentRegistry.mjs +22 -3
- package/src/registry/providers/ArazzoDocumentRegistryProvider.cjs +20 -0
- package/src/registry/providers/ArazzoDocumentRegistryProvider.mjs +21 -1
- package/src/registry/providers/DocumentRegistryProvider.cjs +14 -0
- package/src/registry/providers/DocumentRegistryProvider.mjs +14 -0
- package/src/registry/providers/OpenAPIDocumentRegistryProvider.cjs +27 -5
- package/src/registry/providers/OpenAPIDocumentRegistryProvider.mjs +27 -5
- package/types/runner.d.ts +705 -5
|
@@ -8859,8 +8859,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8859
8859
|
* Every option is a seam of a building block the runner wires: `registry` is
|
|
8860
8860
|
* the {@link DocumentRegistry} the documents load into (a fresh one with the
|
|
8861
8861
|
* default providers when omitted), `reference` goes to everything the runner
|
|
8862
|
-
* builds that retrieves documents, `httpClient
|
|
8863
|
-
* the {@link OpenAPIOperationExecutor}, and the rest go
|
|
8862
|
+
* builds that retrieves documents, `httpClient`, `requestInterceptor` and
|
|
8863
|
+
* `captureBodies` go to the {@link OpenAPIOperationExecutor}, and the rest go
|
|
8864
|
+
* to the
|
|
8864
8865
|
* {@link WorkflowExecutor}.
|
|
8865
8866
|
*
|
|
8866
8867
|
* Retrieving documents and calling APIs are separate on purpose: `reference`
|
|
@@ -8901,10 +8902,24 @@ class ArazzoRunner {
|
|
|
8901
8902
|
static async load(uri, options = {}) {
|
|
8902
8903
|
// `resolve` only, whatever else the given object carries
|
|
8903
8904
|
const referenceOptions = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['resolve'], options.reference ?? {});
|
|
8905
|
+
// source maps need the non-strict parsers, which are the ones that keep
|
|
8906
|
+
// positions
|
|
8907
|
+
const providerOptions = options.sourceMap ? {
|
|
8908
|
+
...referenceOptions,
|
|
8909
|
+
parse: {
|
|
8910
|
+
parserOpts: {
|
|
8911
|
+
sourceMap: true,
|
|
8912
|
+
strict: false
|
|
8913
|
+
}
|
|
8914
|
+
}
|
|
8915
|
+
} : referenceOptions;
|
|
8904
8916
|
const {
|
|
8905
8917
|
registry = new _registry_DocumentRegistry_ts__WEBPACK_IMPORTED_MODULE_1__["default"]({
|
|
8906
|
-
providers: [new _registry_providers_ArazzoDocumentRegistryProvider_ts__WEBPACK_IMPORTED_MODULE_2__["default"](
|
|
8918
|
+
providers: [new _registry_providers_ArazzoDocumentRegistryProvider_ts__WEBPACK_IMPORTED_MODULE_2__["default"](providerOptions), new _registry_providers_OpenAPIDocumentRegistryProvider_ts__WEBPACK_IMPORTED_MODULE_3__["default"](providerOptions)],
|
|
8919
|
+
observer: options.observer,
|
|
8920
|
+
now: options.now
|
|
8907
8921
|
}),
|
|
8922
|
+
sourceMap: _sourceMap,
|
|
8908
8923
|
...rest
|
|
8909
8924
|
} = options;
|
|
8910
8925
|
// acquiring a second entry would pin it for good and, through the LRU
|
|
@@ -8936,6 +8951,7 @@ class ArazzoRunner {
|
|
|
8936
8951
|
reference,
|
|
8937
8952
|
httpClient,
|
|
8938
8953
|
requestInterceptor,
|
|
8954
|
+
captureBodies,
|
|
8939
8955
|
...workflowExecutorOptions
|
|
8940
8956
|
} = options;
|
|
8941
8957
|
|
|
@@ -8949,9 +8965,16 @@ class ArazzoRunner {
|
|
|
8949
8965
|
|
|
8950
8966
|
// `resolve` only, whatever else the given object carries
|
|
8951
8967
|
const referenceOptions = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['resolve'], reference ?? {});
|
|
8968
|
+
const {
|
|
8969
|
+
observer,
|
|
8970
|
+
now
|
|
8971
|
+
} = workflowExecutorOptions;
|
|
8952
8972
|
const operationExecutor = new _executor_OpenAPIOperationExecutor_ts__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
8953
8973
|
httpClient,
|
|
8954
8974
|
requestInterceptor,
|
|
8975
|
+
captureBodies,
|
|
8976
|
+
observer,
|
|
8977
|
+
now,
|
|
8955
8978
|
operationNormalizer: new _normalizer_OpenAPIOperationNormalizer_ts__WEBPACK_IMPORTED_MODULE_5__["default"]({
|
|
8956
8979
|
openapi2: new _normalizer_OpenAPI2OperationNormalizer_ts__WEBPACK_IMPORTED_MODULE_6__["default"](referenceOptions),
|
|
8957
8980
|
openapi30: new _normalizer_OpenAPI30OperationNormalizer_ts__WEBPACK_IMPORTED_MODULE_7__["default"](referenceOptions),
|
|
@@ -9684,6 +9707,15 @@ class OpenAPIOperationResponse {
|
|
|
9684
9707
|
this.request = raw.request;
|
|
9685
9708
|
}
|
|
9686
9709
|
|
|
9710
|
+
/**
|
|
9711
|
+
* The body's size in bytes, as read: after the transport decoded any
|
|
9712
|
+
* `Content-Encoding`, so a compressed body counts at its decoded size.
|
|
9713
|
+
*/
|
|
9714
|
+
get size() {
|
|
9715
|
+
// a string content encodes back to exactly the bytes received
|
|
9716
|
+
return typeof this.#content === 'string' ? new TextEncoder().encode(this.#content).length : this.#content.length;
|
|
9717
|
+
}
|
|
9718
|
+
|
|
9687
9719
|
/**
|
|
9688
9720
|
* The body as text, like `Response.text()`; `''` when there is none.
|
|
9689
9721
|
*/
|
|
@@ -10583,6 +10615,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10583
10615
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87659);
|
|
10584
10616
|
|
|
10585
10617
|
|
|
10618
|
+
/**
|
|
10619
|
+
* A position in a document, as in the Language Server Protocol: a 0-based
|
|
10620
|
+
* line, and a 0-based character offset within it in UTF-16 code units.
|
|
10621
|
+
* @public
|
|
10622
|
+
*/
|
|
10623
|
+
|
|
10624
|
+
/**
|
|
10625
|
+
* A range in a document, as in the Language Server Protocol: from `start` to
|
|
10626
|
+
* `end`, the shape the validator's diagnostics use.
|
|
10627
|
+
* @public
|
|
10628
|
+
*/
|
|
10629
|
+
|
|
10630
|
+
/**
|
|
10631
|
+
* Where an element is written.
|
|
10632
|
+
* @public
|
|
10633
|
+
*/
|
|
10634
|
+
|
|
10586
10635
|
/**
|
|
10587
10636
|
* Base document held by the document registry.
|
|
10588
10637
|
* @public
|
|
@@ -10595,6 +10644,42 @@ class APIDocument {
|
|
|
10595
10644
|
this.parseResult = parseResult;
|
|
10596
10645
|
}
|
|
10597
10646
|
|
|
10647
|
+
/**
|
|
10648
|
+
* Where an element of this document, or one it references, is written, as
|
|
10649
|
+
* the registry provider recorded it when it loaded the document: the
|
|
10650
|
+
* document it came from (its `ref-origin`) when it came through a
|
|
10651
|
+
* reference, and its JSON Pointer there.
|
|
10652
|
+
*/
|
|
10653
|
+
locationOf(element) {
|
|
10654
|
+
const origin = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element.meta.get('ref-origin'));
|
|
10655
|
+
const jsonPointer = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element.meta.get('json-pointer'));
|
|
10656
|
+
const {
|
|
10657
|
+
startLine,
|
|
10658
|
+
startCharacter,
|
|
10659
|
+
endLine,
|
|
10660
|
+
endCharacter
|
|
10661
|
+
} = element;
|
|
10662
|
+
return {
|
|
10663
|
+
uri: typeof origin === 'string' ? origin : this.uri,
|
|
10664
|
+
...(typeof jsonPointer === 'string' && {
|
|
10665
|
+
jsonPointer
|
|
10666
|
+
}),
|
|
10667
|
+
// a source-mapped parse positions every element fully, any other none
|
|
10668
|
+
...(startLine !== undefined && {
|
|
10669
|
+
range: {
|
|
10670
|
+
start: {
|
|
10671
|
+
line: startLine,
|
|
10672
|
+
character: startCharacter
|
|
10673
|
+
},
|
|
10674
|
+
end: {
|
|
10675
|
+
line: endLine,
|
|
10676
|
+
character: endCharacter
|
|
10677
|
+
}
|
|
10678
|
+
}
|
|
10679
|
+
})
|
|
10680
|
+
};
|
|
10681
|
+
}
|
|
10682
|
+
|
|
10598
10683
|
/**
|
|
10599
10684
|
* Returns a JSON-serializable representation of the document's API element.
|
|
10600
10685
|
* Compatible with JSON.stringify() — JSON.stringify(doc) produces correct output.
|
|
@@ -11655,6 +11740,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11655
11740
|
/* harmony import */ var _normalizer_OpenAPIOperationNormalizer_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(87864);
|
|
11656
11741
|
/* harmony import */ var _assembler_OpenAPIDocumentAssembler_ts__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(6898);
|
|
11657
11742
|
/* harmony import */ var _errors_ClientError_ts__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(81763);
|
|
11743
|
+
/* harmony import */ var _observability_EventChannel_ts__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(12993);
|
|
11658
11744
|
|
|
11659
11745
|
|
|
11660
11746
|
|
|
@@ -11674,6 +11760,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11674
11760
|
|
|
11675
11761
|
|
|
11676
11762
|
|
|
11763
|
+
|
|
11677
11764
|
/**
|
|
11678
11765
|
* The Arazzo step a request is issued for: its `stepId`, and the `workflowId`
|
|
11679
11766
|
* of the workflow it belongs to when the caller names one (step ids are only
|
|
@@ -11820,6 +11907,8 @@ class OpenAPIOperationExecutor {
|
|
|
11820
11907
|
#operationExtractor;
|
|
11821
11908
|
#operationNormalizer;
|
|
11822
11909
|
#documentAssembler;
|
|
11910
|
+
#captureBodies;
|
|
11911
|
+
#events;
|
|
11823
11912
|
constructor(options = {}) {
|
|
11824
11913
|
this.#httpClient = options.httpClient ?? _client_HTTPClientFetch_ts__WEBPACK_IMPORTED_MODULE_10__["default"];
|
|
11825
11914
|
this.#requestInterceptor = options.requestInterceptor;
|
|
@@ -11827,6 +11916,11 @@ class OpenAPIOperationExecutor {
|
|
|
11827
11916
|
this.#operationExtractor = options.operationExtractor ?? new _extractor_OpenAPIOperationExtractor_ts__WEBPACK_IMPORTED_MODULE_12__["default"]();
|
|
11828
11917
|
this.#operationNormalizer = options.operationNormalizer ?? new _normalizer_OpenAPIOperationNormalizer_ts__WEBPACK_IMPORTED_MODULE_13__["default"]();
|
|
11829
11918
|
this.#documentAssembler = options.documentAssembler ?? new _assembler_OpenAPIDocumentAssembler_ts__WEBPACK_IMPORTED_MODULE_14__["default"]();
|
|
11919
|
+
this.#events = _observability_EventChannel_ts__WEBPACK_IMPORTED_MODULE_16__["default"].open({
|
|
11920
|
+
observer: options.observer,
|
|
11921
|
+
now: options.now
|
|
11922
|
+
});
|
|
11923
|
+
this.#captureBodies = options.captureBodies ?? false;
|
|
11830
11924
|
}
|
|
11831
11925
|
|
|
11832
11926
|
/**
|
|
@@ -11847,17 +11941,19 @@ class OpenAPIOperationExecutor {
|
|
|
11847
11941
|
// the legacy id (`{method}-{path}`) matches regardless of an explicit
|
|
11848
11942
|
// `operationId` in the assembled document
|
|
11849
11943
|
const operationId = (0,_vendor_swagger_client_mjs__WEBPACK_IMPORTED_MODULE_8__.idFromPathMethodLegacy)((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(operation.meta.get('path')), (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(operation.meta.get('http-method')));
|
|
11850
|
-
const normalizedOperation = await this.#operationNormalizer.normalize(operation, locator.document);
|
|
11851
|
-
const assembled = this.#documentAssembler.assemble(normalizedOperation, locator.document);
|
|
11852
|
-
|
|
11853
11944
|
// the interceptor and step are consumed here, the target always comes from
|
|
11854
11945
|
// the locator, and the transport is the httpClient, so none of these
|
|
11855
11946
|
// reach buildRequest
|
|
11856
11947
|
const {
|
|
11857
11948
|
requestInterceptor,
|
|
11858
|
-
step
|
|
11949
|
+
step,
|
|
11950
|
+
runId
|
|
11859
11951
|
} = executeOptions;
|
|
11860
|
-
|
|
11952
|
+
// the operation as extracted from its own document, before normalizing
|
|
11953
|
+
// copies it, carries where it is written; located once, and only for an
|
|
11954
|
+
// observer.
|
|
11955
|
+
let located;
|
|
11956
|
+
const location = () => located ??= locator.document.locationOf(operation);
|
|
11861
11957
|
const declaredOperationId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(operation.operationId);
|
|
11862
11958
|
const context = {
|
|
11863
11959
|
operation: {
|
|
@@ -11880,6 +11976,27 @@ class OpenAPIOperationExecutor {
|
|
|
11880
11976
|
}
|
|
11881
11977
|
})
|
|
11882
11978
|
};
|
|
11979
|
+
this.#events?.emit({
|
|
11980
|
+
type: 'openapi-operation-normalize-start',
|
|
11981
|
+
...context,
|
|
11982
|
+
runId,
|
|
11983
|
+
location: location()
|
|
11984
|
+
});
|
|
11985
|
+
const normalizedOperation = await this.#operationNormalizer.normalize(operation, locator.document);
|
|
11986
|
+
this.#events?.emit({
|
|
11987
|
+
type: 'openapi-operation-normalize-settled',
|
|
11988
|
+
...context,
|
|
11989
|
+
runId,
|
|
11990
|
+
location: location()
|
|
11991
|
+
});
|
|
11992
|
+
const assembled = this.#documentAssembler.assemble(normalizedOperation, locator.document);
|
|
11993
|
+
this.#events?.emit({
|
|
11994
|
+
type: 'openapi-operation-assembled',
|
|
11995
|
+
...context,
|
|
11996
|
+
runId,
|
|
11997
|
+
location: location()
|
|
11998
|
+
});
|
|
11999
|
+
const rest = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['requestInterceptor', 'step', 'runId', 'operationId', 'operationPath', 'userFetch', 'responseInterceptor'], executeOptions);
|
|
11883
12000
|
|
|
11884
12001
|
// each step derives the next options rather than editing in place
|
|
11885
12002
|
const withServer = this.#applyServerOptions(rest, normalizedOperation, locator.document);
|
|
@@ -11923,6 +12040,20 @@ class OpenAPIOperationExecutor {
|
|
|
11923
12040
|
},
|
|
11924
12041
|
body: request.body
|
|
11925
12042
|
};
|
|
12043
|
+
this.#events?.emit({
|
|
12044
|
+
type: 'openapi-operation-request-start',
|
|
12045
|
+
...context,
|
|
12046
|
+
runId,
|
|
12047
|
+
location: location(),
|
|
12048
|
+
request: {
|
|
12049
|
+
method: request.method,
|
|
12050
|
+
url: request.url,
|
|
12051
|
+
headers: request.headers,
|
|
12052
|
+
...(this.#captureBodies ? {
|
|
12053
|
+
body: request.body
|
|
12054
|
+
} : {})
|
|
12055
|
+
}
|
|
12056
|
+
});
|
|
11926
12057
|
let rawResponse;
|
|
11927
12058
|
try {
|
|
11928
12059
|
rawResponse = await this.#httpClient(request);
|
|
@@ -11932,7 +12063,22 @@ class OpenAPIOperationExecutor {
|
|
|
11932
12063
|
cause: error
|
|
11933
12064
|
});
|
|
11934
12065
|
}
|
|
11935
|
-
|
|
12066
|
+
const response = await this.#responseNormalizer.normalize(rawResponse, requestInfo);
|
|
12067
|
+
this.#events?.emit({
|
|
12068
|
+
type: 'openapi-operation-request-settled',
|
|
12069
|
+
...context,
|
|
12070
|
+
runId,
|
|
12071
|
+
location: location(),
|
|
12072
|
+
response: {
|
|
12073
|
+
status: response.status,
|
|
12074
|
+
headers: response.headers,
|
|
12075
|
+
size: response.size,
|
|
12076
|
+
...(this.#captureBodies ? {
|
|
12077
|
+
body: response.body
|
|
12078
|
+
} : {})
|
|
12079
|
+
}
|
|
12080
|
+
});
|
|
12081
|
+
return response;
|
|
11936
12082
|
}
|
|
11937
12083
|
|
|
11938
12084
|
/**
|
|
@@ -13087,18 +13233,30 @@ class StepExecutor {
|
|
|
13087
13233
|
*/
|
|
13088
13234
|
async #evaluateCriterion(criterion, context) {
|
|
13089
13235
|
const condition = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(criterion.condition);
|
|
13236
|
+
const location = this.#document.locationOf(criterion);
|
|
13237
|
+
const values = {};
|
|
13238
|
+
const resolve = async expression => {
|
|
13239
|
+
const value = await this.#evaluate(context, expression);
|
|
13240
|
+
const wholeBody = expression === '$response.body' || expression === '$request.body';
|
|
13241
|
+
values[expression] = wholeBody ? '[body]' : value;
|
|
13242
|
+
return value;
|
|
13243
|
+
};
|
|
13090
13244
|
try {
|
|
13091
13245
|
const {
|
|
13092
13246
|
met,
|
|
13093
13247
|
error
|
|
13094
|
-
} = await this.#criterionEvaluator.evaluate(criterion,
|
|
13248
|
+
} = await this.#criterionEvaluator.evaluate(criterion, resolve);
|
|
13095
13249
|
if (error === undefined) return {
|
|
13096
13250
|
condition,
|
|
13097
|
-
met
|
|
13251
|
+
met,
|
|
13252
|
+
values,
|
|
13253
|
+
location
|
|
13098
13254
|
};
|
|
13099
13255
|
return {
|
|
13100
13256
|
condition,
|
|
13101
13257
|
met,
|
|
13258
|
+
values,
|
|
13259
|
+
location,
|
|
13102
13260
|
diagnostic: {
|
|
13103
13261
|
code: error.reason,
|
|
13104
13262
|
message: error.message
|
|
@@ -13112,6 +13270,8 @@ class StepExecutor {
|
|
|
13112
13270
|
return {
|
|
13113
13271
|
condition,
|
|
13114
13272
|
met: false,
|
|
13273
|
+
values,
|
|
13274
|
+
location,
|
|
13115
13275
|
diagnostic: {
|
|
13116
13276
|
code: error.reason,
|
|
13117
13277
|
message: error.message
|
|
@@ -13272,7 +13432,8 @@ class StepRetryRunner {
|
|
|
13272
13432
|
|
|
13273
13433
|
/**
|
|
13274
13434
|
* Runs `attempt` until the step succeeds, a terminal failure action is reached,
|
|
13275
|
-
* or its retries are exhausted.
|
|
13435
|
+
* or its retries are exhausted. Each call is given its attempt number,
|
|
13436
|
+
* starting at 1.
|
|
13276
13437
|
*/
|
|
13277
13438
|
async run(attempt, context) {
|
|
13278
13439
|
// attempts already spent on each retry action, keyed by the action element.
|
|
@@ -13286,7 +13447,7 @@ class StepRetryRunner {
|
|
|
13286
13447
|
const retriesSpent = new Map();
|
|
13287
13448
|
let attempts = 0;
|
|
13288
13449
|
for (;;) {
|
|
13289
|
-
const outcome = await attempt();
|
|
13450
|
+
const outcome = await attempt(attempts + 1);
|
|
13290
13451
|
attempts += 1;
|
|
13291
13452
|
if (outcome.successful) {
|
|
13292
13453
|
return {
|
|
@@ -13320,8 +13481,9 @@ class StepRetryRunner {
|
|
|
13320
13481
|
// sleep(0) for immediate retries, and never hand a custom sleep a
|
|
13321
13482
|
// zero/negative/NaN value.
|
|
13322
13483
|
const delayMs = this.#retryAfterMs(action);
|
|
13484
|
+
context.onRetry?.(action, delayMs, attempts);
|
|
13323
13485
|
if (delayMs > 0) await this.#sleep(delayMs, context.signal);
|
|
13324
|
-
if (runReference !== undefined) await runReference(action, outcome);
|
|
13486
|
+
if (runReference !== undefined) await runReference(action, outcome, attempts);
|
|
13325
13487
|
fired = true;
|
|
13326
13488
|
break;
|
|
13327
13489
|
}
|
|
@@ -13435,7 +13597,7 @@ function actionTargets(action) {
|
|
|
13435
13597
|
* workflow; `transfer` hands control one-way to another workflow, which the
|
|
13436
13598
|
* caller's run then ends on; `end` stops the run with `status: ended`; `break`
|
|
13437
13599
|
* stops with `status: failed` (the failure default).
|
|
13438
|
-
* @
|
|
13600
|
+
* @public
|
|
13439
13601
|
*/
|
|
13440
13602
|
|
|
13441
13603
|
/**
|
|
@@ -13580,7 +13742,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13580
13742
|
* reference — or a `goto`'s one-way transfer to a `workflowId` — is a call
|
|
13581
13743
|
* cycle. `retry` and `goto` are grouped with `step` for that classification, not
|
|
13582
13744
|
* `dependsOn`: each is a call the current step makes, not a stated precondition.
|
|
13583
|
-
* @
|
|
13745
|
+
* @public
|
|
13584
13746
|
*/
|
|
13585
13747
|
|
|
13586
13748
|
/**
|
|
@@ -13696,22 +13858,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13696
13858
|
/* harmony export */ });
|
|
13697
13859
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7456);
|
|
13698
13860
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34606);
|
|
13699
|
-
/* harmony import */ var
|
|
13700
|
-
/* harmony import */ var
|
|
13701
|
-
/* harmony import */ var
|
|
13702
|
-
/* harmony import */ var
|
|
13703
|
-
/* harmony import */ var
|
|
13704
|
-
/* harmony import */ var
|
|
13705
|
-
/* harmony import */ var
|
|
13706
|
-
/* harmony import */ var
|
|
13707
|
-
/* harmony import */ var
|
|
13708
|
-
/* harmony import */ var
|
|
13709
|
-
/* harmony import */ var
|
|
13710
|
-
/* harmony import */ var
|
|
13711
|
-
/* harmony import */ var
|
|
13712
|
-
/* harmony import */ var
|
|
13713
|
-
/* harmony import */ var
|
|
13714
|
-
/* harmony import */ var
|
|
13861
|
+
/* harmony import */ var short_unique_id__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24279);
|
|
13862
|
+
/* harmony import */ var short_unique_id__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(short_unique_id__WEBPACK_IMPORTED_MODULE_2__);
|
|
13863
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(62823);
|
|
13864
|
+
/* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75728);
|
|
13865
|
+
/* harmony import */ var _expression_RuntimeExpressionEvaluator_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77370);
|
|
13866
|
+
/* harmony import */ var _extractor_ArazzoWorkflowExtractor_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(77447);
|
|
13867
|
+
/* harmony import */ var _normalizer_ArazzoWorkflowNormalizer_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75055);
|
|
13868
|
+
/* harmony import */ var _resolver_OutputResolver_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(99494);
|
|
13869
|
+
/* harmony import */ var _resolver_WorkflowParameterResolver_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(95839);
|
|
13870
|
+
/* harmony import */ var _state_WorkflowExecutionState_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61596);
|
|
13871
|
+
/* harmony import */ var _StepExecutor_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(96007);
|
|
13872
|
+
/* harmony import */ var _ArazzoWorkflowLocatorNormalizer_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(98885);
|
|
13873
|
+
/* harmony import */ var _StepRetryRunner_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(18760);
|
|
13874
|
+
/* harmony import */ var _WorkflowCallStack_ts__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(64661);
|
|
13875
|
+
/* harmony import */ var _StepTransitionInterpreter_ts__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(2835);
|
|
13876
|
+
/* harmony import */ var _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(17658);
|
|
13877
|
+
/* harmony import */ var _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(8696);
|
|
13878
|
+
/* harmony import */ var _abort_ts__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(99628);
|
|
13879
|
+
/* harmony import */ var _observability_EventChannel_ts__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(12993);
|
|
13880
|
+
|
|
13881
|
+
|
|
13715
13882
|
|
|
13716
13883
|
|
|
13717
13884
|
|
|
@@ -13823,6 +13990,14 @@ function settledResult(result) {
|
|
|
13823
13990
|
* travel together into everything it delegates to.
|
|
13824
13991
|
*/
|
|
13825
13992
|
|
|
13993
|
+
/**
|
|
13994
|
+
* What every event of one workflow invocation shares.
|
|
13995
|
+
*/
|
|
13996
|
+
|
|
13997
|
+
/**
|
|
13998
|
+
* What every step-scoped event of one step shares.
|
|
13999
|
+
*/
|
|
14000
|
+
|
|
13826
14001
|
/**
|
|
13827
14002
|
* Executes an Arazzo workflow: the stateful loop that turns "run one step" into
|
|
13828
14003
|
* "run a workflow".
|
|
@@ -13868,30 +14043,43 @@ class WorkflowExecutor {
|
|
|
13868
14043
|
static #DEFAULT_MAX_STEPS = 1000;
|
|
13869
14044
|
static #DEFAULT_MAX_WORKFLOW_DEPTH = 32;
|
|
13870
14045
|
static #DEFAULT_NOW = () => performance.now();
|
|
14046
|
+
/**
|
|
14047
|
+
* Generates each run's `runId`: random rather than counted, so the events
|
|
14048
|
+
* of runs in different processes stay apart once collected in one place.
|
|
14049
|
+
* It needs no Web Crypto, which browsers offer only on secure pages.
|
|
14050
|
+
*/
|
|
14051
|
+
static #RUN_IDS = new (short_unique_id__WEBPACK_IMPORTED_MODULE_2___default())({
|
|
14052
|
+
length: 12
|
|
14053
|
+
});
|
|
13871
14054
|
static #EXECUTE_OPTION_KEYS = new Set(['inputs', 'executeOptions', 'dependencyInputs', 'runDependencies', 'signal']);
|
|
13872
14055
|
#document;
|
|
13873
14056
|
#registry;
|
|
13874
14057
|
#maxSteps;
|
|
13875
14058
|
#maxWorkflowDepth;
|
|
13876
14059
|
#now;
|
|
13877
|
-
#extractor = new
|
|
14060
|
+
#extractor = new _extractor_ArazzoWorkflowExtractor_ts__WEBPACK_IMPORTED_MODULE_6__["default"]();
|
|
13878
14061
|
#normalizer;
|
|
13879
|
-
#outputResolver = new
|
|
13880
|
-
#parameterResolver = new
|
|
14062
|
+
#outputResolver = new _resolver_OutputResolver_ts__WEBPACK_IMPORTED_MODULE_8__["default"]();
|
|
14063
|
+
#parameterResolver = new _resolver_WorkflowParameterResolver_ts__WEBPACK_IMPORTED_MODULE_9__["default"]();
|
|
13881
14064
|
#stepExecutor;
|
|
13882
14065
|
#retryRunner;
|
|
13883
|
-
#interpreter = new
|
|
14066
|
+
#interpreter = new _StepTransitionInterpreter_ts__WEBPACK_IMPORTED_MODULE_15__["default"]();
|
|
13884
14067
|
#workflowLocatorNormalizer;
|
|
14068
|
+
#events;
|
|
13885
14069
|
constructor(options) {
|
|
13886
14070
|
this.#document = options.document;
|
|
13887
14071
|
this.#registry = options.registry;
|
|
13888
|
-
this.#workflowLocatorNormalizer = new
|
|
13889
|
-
this.#normalizer = options.workflowNormalizer ?? new
|
|
14072
|
+
this.#workflowLocatorNormalizer = new _ArazzoWorkflowLocatorNormalizer_ts__WEBPACK_IMPORTED_MODULE_12__["default"](options.registry);
|
|
14073
|
+
this.#normalizer = options.workflowNormalizer ?? new _normalizer_ArazzoWorkflowNormalizer_ts__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
13890
14074
|
this.#maxSteps = options.maxSteps ?? WorkflowExecutor.#DEFAULT_MAX_STEPS;
|
|
13891
14075
|
this.#maxWorkflowDepth = options.maxWorkflowDepth ?? WorkflowExecutor.#DEFAULT_MAX_WORKFLOW_DEPTH;
|
|
13892
14076
|
this.#now = options.now ?? WorkflowExecutor.#DEFAULT_NOW;
|
|
14077
|
+
this.#events = _observability_EventChannel_ts__WEBPACK_IMPORTED_MODULE_19__["default"].open({
|
|
14078
|
+
observer: options.observer,
|
|
14079
|
+
now: this.#now
|
|
14080
|
+
});
|
|
13893
14081
|
this.#stepExecutor = options.stepExecutor;
|
|
13894
|
-
this.#retryRunner = new
|
|
14082
|
+
this.#retryRunner = new _StepRetryRunner_ts__WEBPACK_IMPORTED_MODULE_13__["default"]({
|
|
13895
14083
|
sleep: options.sleep
|
|
13896
14084
|
});
|
|
13897
14085
|
}
|
|
@@ -13913,7 +14101,9 @@ class WorkflowExecutor {
|
|
|
13913
14101
|
signal
|
|
13914
14102
|
} = options;
|
|
13915
14103
|
const executeOptions = this.#executeOptionsByName(options.executeOptions ?? {});
|
|
14104
|
+
const runId = `run-${WorkflowExecutor.#RUN_IDS.randomUUID()}`;
|
|
13916
14105
|
const scope = {
|
|
14106
|
+
runId,
|
|
13917
14107
|
// the signal is put into every step's opaque bag, because that bag is
|
|
13918
14108
|
// how anything reaches the transport: the executor's own checks stop the
|
|
13919
14109
|
// run at the next boundary, and this is what cancels the request already
|
|
@@ -13922,7 +14112,9 @@ class WorkflowExecutor {
|
|
|
13922
14112
|
// leave the run walking on.
|
|
13923
14113
|
executeOptions: (locator, step) => ({
|
|
13924
14114
|
...this.#executeOptionsFor(executeOptions, locator, step),
|
|
13925
|
-
signal
|
|
14115
|
+
signal,
|
|
14116
|
+
// set over any entry's own, like the signal: it names this run.
|
|
14117
|
+
runId
|
|
13926
14118
|
}),
|
|
13927
14119
|
dependencyInputs: options.dependencyInputs ?? {},
|
|
13928
14120
|
runDependencies: options.runDependencies ?? true,
|
|
@@ -13936,7 +14128,7 @@ class WorkflowExecutor {
|
|
|
13936
14128
|
return this.#run({
|
|
13937
14129
|
document: this.#document,
|
|
13938
14130
|
workflowId
|
|
13939
|
-
}, options.inputs ?? {}, scope, new
|
|
14131
|
+
}, options.inputs ?? {}, scope, new _WorkflowCallStack_ts__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
13940
14132
|
maxDepth: this.#maxWorkflowDepth,
|
|
13941
14133
|
entryDocumentURI: this.#document.uri
|
|
13942
14134
|
}), 'root');
|
|
@@ -13953,20 +14145,20 @@ class WorkflowExecutor {
|
|
|
13953
14145
|
#executeOptionsByName(executeOptions) {
|
|
13954
14146
|
const byName = new Map();
|
|
13955
14147
|
const fail = (name, problem, reason) => {
|
|
13956
|
-
throw new
|
|
14148
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`executeOptions is keyed by source description name, and "${name}" ${problem}`, {
|
|
13957
14149
|
reason
|
|
13958
14150
|
});
|
|
13959
14151
|
};
|
|
13960
14152
|
for (const [name, options] of Object.entries(executeOptions)) {
|
|
13961
14153
|
const uri = this.#document.resolveSourceDescriptionURI(name);
|
|
13962
14154
|
if (uri === undefined) {
|
|
13963
|
-
return fail(name, `names no source description with a url in the Arazzo document at "${this.#document.uri}"`,
|
|
14155
|
+
return fail(name, `names no source description with a url in the Arazzo document at "${this.#document.uri}"`, _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].SourceDescriptionNotFound);
|
|
13964
14156
|
}
|
|
13965
14157
|
if (this.#document.resolveSourceDescriptionField(name, 'type') === 'arazzo') {
|
|
13966
|
-
fail(name, 'names an Arazzo document',
|
|
14158
|
+
fail(name, 'names an Arazzo document', _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].SourceDescriptionNotOpenAPI);
|
|
13967
14159
|
}
|
|
13968
14160
|
if (!(0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(options)) {
|
|
13969
|
-
fail(name, 'is not given an object of options',
|
|
14161
|
+
fail(name, 'is not given an object of options', _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].UnknownExecuteOption);
|
|
13970
14162
|
}
|
|
13971
14163
|
byName.set(name, {
|
|
13972
14164
|
uri,
|
|
@@ -13988,9 +14180,9 @@ class WorkflowExecutor {
|
|
|
13988
14180
|
const configuring = [...entries].filter(([, entry]) => entry.uri === locator.document.uri);
|
|
13989
14181
|
if (configuring.length > 1) {
|
|
13990
14182
|
const names = configuring.map(([name]) => `"${name}"`).join(', ');
|
|
13991
|
-
throw new
|
|
14183
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`Step "${step.stepId}" has no executeOptions entry of its own, and ${names} all configure "${locator.document.uri}", the document it calls`, {
|
|
13992
14184
|
...step,
|
|
13993
|
-
reason:
|
|
14185
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].AmbiguousExecuteOptions
|
|
13994
14186
|
});
|
|
13995
14187
|
}
|
|
13996
14188
|
return configuring[0]?.[1].options;
|
|
@@ -14009,8 +14201,8 @@ class WorkflowExecutor {
|
|
|
14009
14201
|
#rejectUnknownOptions(options) {
|
|
14010
14202
|
const unknown = Object.keys(options).filter(key => !WorkflowExecutor.#EXECUTE_OPTION_KEYS.has(key));
|
|
14011
14203
|
if (unknown.length === 0) return;
|
|
14012
|
-
throw new
|
|
14013
|
-
reason:
|
|
14204
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`execute received unknown option(s) ${unknown.join(', ')}; it takes (workflowId, { inputs, executeOptions, dependencyInputs, runDependencies, signal }) — workflow inputs go under "inputs"`, {
|
|
14205
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].UnknownExecuteOption
|
|
14014
14206
|
});
|
|
14015
14207
|
}
|
|
14016
14208
|
|
|
@@ -14036,12 +14228,27 @@ class WorkflowExecutor {
|
|
|
14036
14228
|
// run cancelled before any step — or between a prerequisite and the workflow
|
|
14037
14229
|
// that needed it — must not go on to normalize and enter a workflow nobody
|
|
14038
14230
|
// is waiting for.
|
|
14039
|
-
(0,
|
|
14231
|
+
(0,_abort_ts__WEBPACK_IMPORTED_MODULE_18__.throwIfAborted)(scope.signal, {
|
|
14040
14232
|
workflowId,
|
|
14041
14233
|
callStack: nested
|
|
14042
14234
|
});
|
|
14043
|
-
const
|
|
14044
|
-
|
|
14235
|
+
const frame = {
|
|
14236
|
+
runId: scope.runId,
|
|
14237
|
+
workflowId,
|
|
14238
|
+
path: nested.path
|
|
14239
|
+
};
|
|
14240
|
+
// extracted before `workflow-start`: a workflow its document does not
|
|
14241
|
+
// define never starts, and the event can say where the one it runs is.
|
|
14242
|
+
const extracted = this.#extractWorkflow(locator);
|
|
14243
|
+
// emitted before normalization, so its events nest inside this workflow's.
|
|
14244
|
+
this.#events?.emit({
|
|
14245
|
+
type: 'workflow-start',
|
|
14246
|
+
...frame,
|
|
14247
|
+
via,
|
|
14248
|
+
location: locator.document.locationOf(extracted)
|
|
14249
|
+
}, startedAt);
|
|
14250
|
+
const workflow = await this.#resolveWorkflow(locator, extracted, scope, frame);
|
|
14251
|
+
const state = new _state_WorkflowExecutionState_ts__WEBPACK_IMPORTED_MODULE_10__["default"]({
|
|
14045
14252
|
inputs
|
|
14046
14253
|
});
|
|
14047
14254
|
const invocation = {
|
|
@@ -14049,7 +14256,8 @@ class WorkflowExecutor {
|
|
|
14049
14256
|
document: locator.document,
|
|
14050
14257
|
state,
|
|
14051
14258
|
callStack: nested,
|
|
14052
|
-
via
|
|
14259
|
+
via,
|
|
14260
|
+
frame
|
|
14053
14261
|
};
|
|
14054
14262
|
|
|
14055
14263
|
// validated before any prerequisite runs: a malformed `steps` is an
|
|
@@ -14083,7 +14291,7 @@ class WorkflowExecutor {
|
|
|
14083
14291
|
// result carrying the dependency trace, not a throw — and none of its own
|
|
14084
14292
|
// steps run. Unless the run was cancelled, in which case the prerequisite
|
|
14085
14293
|
// did not fail on its own terms either.
|
|
14086
|
-
(0,
|
|
14294
|
+
(0,_abort_ts__WEBPACK_IMPORTED_MODULE_18__.throwIfAborted)(scope.signal, {
|
|
14087
14295
|
workflowId,
|
|
14088
14296
|
callStack: nested
|
|
14089
14297
|
});
|
|
@@ -14112,7 +14320,16 @@ class WorkflowExecutor {
|
|
|
14112
14320
|
// separate from `subWorkflows` because a reference belongs to the retry
|
|
14113
14321
|
// that invoked it, not to the step's own target.
|
|
14114
14322
|
const retryReferences = [];
|
|
14115
|
-
const
|
|
14323
|
+
const stepFrame = {
|
|
14324
|
+
...frame,
|
|
14325
|
+
stepId
|
|
14326
|
+
};
|
|
14327
|
+
this.#events?.emit({
|
|
14328
|
+
type: 'step-start',
|
|
14329
|
+
...stepFrame,
|
|
14330
|
+
location: invocation.document.locationOf(step)
|
|
14331
|
+
}, stepStartedAt);
|
|
14332
|
+
const attempt = this.#chargedAttempt(this.#observedAttempt(this.#stepAttempt(step, stepId, invocation, scope, subWorkflows), stepFrame), invocation, scope, stepId);
|
|
14116
14333
|
|
|
14117
14334
|
// the retry runner settles any `retry` actions, so `action` is the terminal
|
|
14118
14335
|
// action a retry chain resolved to and `attempts` is how many times the step
|
|
@@ -14125,15 +14342,51 @@ class WorkflowExecutor {
|
|
|
14125
14342
|
stepId,
|
|
14126
14343
|
workflowId,
|
|
14127
14344
|
signal: scope.signal,
|
|
14128
|
-
runReference: this.#retryReference(steps,
|
|
14345
|
+
runReference: this.#retryReference(steps, stepFrame, invocation, scope, retryReferences),
|
|
14346
|
+
onRetry: (retry, delayMs, attempt) => {
|
|
14347
|
+
const decided = {
|
|
14348
|
+
...stepFrame,
|
|
14349
|
+
attempt
|
|
14350
|
+
};
|
|
14351
|
+
this.#events?.emit({
|
|
14352
|
+
type: 'action-selected',
|
|
14353
|
+
...decided,
|
|
14354
|
+
action: retry,
|
|
14355
|
+
transition: {
|
|
14356
|
+
kind: 'retry'
|
|
14357
|
+
},
|
|
14358
|
+
location: invocation.document.locationOf(retry)
|
|
14359
|
+
});
|
|
14360
|
+
if (delayMs > 0) {
|
|
14361
|
+
this.#events?.emit({
|
|
14362
|
+
type: 'retry-wait',
|
|
14363
|
+
...decided,
|
|
14364
|
+
delayMs
|
|
14365
|
+
});
|
|
14366
|
+
}
|
|
14367
|
+
}
|
|
14368
|
+
});
|
|
14369
|
+
const transition = this.#interpreter.interpret(action, outcome.successful, {
|
|
14370
|
+
workflowId,
|
|
14371
|
+
stepId
|
|
14372
|
+
});
|
|
14373
|
+
this.#events?.emit({
|
|
14374
|
+
type: 'action-selected',
|
|
14375
|
+
...stepFrame,
|
|
14376
|
+
attempt: attempts,
|
|
14377
|
+
action,
|
|
14378
|
+
transition,
|
|
14379
|
+
location: action === undefined ? undefined : invocation.document.locationOf(action)
|
|
14129
14380
|
});
|
|
14130
14381
|
state.setStepOutputs(outcome.stepId, outcome.outputs);
|
|
14382
|
+
const stepSettledAt = this.#now();
|
|
14131
14383
|
trace.push({
|
|
14132
14384
|
stepId: outcome.stepId,
|
|
14385
|
+
location: invocation.document.locationOf(step),
|
|
14133
14386
|
successful: outcome.successful,
|
|
14134
14387
|
action,
|
|
14135
14388
|
attempts,
|
|
14136
|
-
durationMs:
|
|
14389
|
+
durationMs: stepSettledAt - stepStartedAt,
|
|
14137
14390
|
successCriteria: outcome.successCriteria,
|
|
14138
14391
|
actionCriteria: outcome.actionCriteria,
|
|
14139
14392
|
...(subWorkflows.length > 0 ? {
|
|
@@ -14143,17 +14396,19 @@ class WorkflowExecutor {
|
|
|
14143
14396
|
retryReferences
|
|
14144
14397
|
} : {})
|
|
14145
14398
|
});
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14399
|
+
this.#events?.emit({
|
|
14400
|
+
type: 'step-settled',
|
|
14401
|
+
...stepFrame,
|
|
14402
|
+
successful: outcome.successful,
|
|
14403
|
+
attempts
|
|
14404
|
+
}, stepSettledAt);
|
|
14150
14405
|
switch (transition.kind) {
|
|
14151
14406
|
case 'next':
|
|
14152
14407
|
index += 1;
|
|
14153
14408
|
break;
|
|
14154
14409
|
case 'goto':
|
|
14155
14410
|
index = this.#interpreter.indexOfStep(steps, transition.stepId, workflowId, {
|
|
14156
|
-
reason:
|
|
14411
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].GotoTargetNotFound,
|
|
14157
14412
|
label: 'goto target'
|
|
14158
14413
|
});
|
|
14159
14414
|
break;
|
|
@@ -14166,7 +14421,7 @@ class WorkflowExecutor {
|
|
|
14166
14421
|
// resolution, so an aborted run reports `aborted` rather than
|
|
14167
14422
|
// whatever resolving the target (a malformed reference, a missing
|
|
14168
14423
|
// source) would have thrown.
|
|
14169
|
-
(0,
|
|
14424
|
+
(0,_abort_ts__WEBPACK_IMPORTED_MODULE_18__.throwIfAborted)(scope.signal, {
|
|
14170
14425
|
workflowId,
|
|
14171
14426
|
stepId,
|
|
14172
14427
|
callStack: nested
|
|
@@ -14192,15 +14447,15 @@ class WorkflowExecutor {
|
|
|
14192
14447
|
break stepLoop;
|
|
14193
14448
|
default:
|
|
14194
14449
|
{
|
|
14195
|
-
// exhaustiveness guard: a
|
|
14450
|
+
// exhaustiveness guard: a StepTransition kind added above without a case
|
|
14196
14451
|
// here would otherwise fall through silently instead of failing
|
|
14197
14452
|
// loudly — `transition` is provably `never` once every kind above
|
|
14198
14453
|
// has its own case, which TypeScript checks at compile time.
|
|
14199
14454
|
const unreachable = transition;
|
|
14200
|
-
throw new
|
|
14455
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`step "${stepId}" in workflow "${workflowId}" produced an unrecognized transition ${JSON.stringify(unreachable)}`, {
|
|
14201
14456
|
workflowId,
|
|
14202
14457
|
stepId,
|
|
14203
|
-
reason:
|
|
14458
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].UnknownTransitionKind
|
|
14204
14459
|
});
|
|
14205
14460
|
}
|
|
14206
14461
|
}
|
|
@@ -14212,7 +14467,7 @@ class WorkflowExecutor {
|
|
|
14212
14467
|
// transport, since one honoring the signal fails the request instead.
|
|
14213
14468
|
// Cancellation must not be the one outcome that reads differently for the
|
|
14214
14469
|
// last step than for every step before it.
|
|
14215
|
-
;(0,
|
|
14470
|
+
;(0,_abort_ts__WEBPACK_IMPORTED_MODULE_18__.throwIfAborted)(scope.signal, {
|
|
14216
14471
|
workflowId,
|
|
14217
14472
|
callStack: nested
|
|
14218
14473
|
});
|
|
@@ -14236,33 +14491,39 @@ class WorkflowExecutor {
|
|
|
14236
14491
|
* the shape up front, independent of resolving it.
|
|
14237
14492
|
*/
|
|
14238
14493
|
async #result(invocation, workflow, steps, outcome, dependencies, startedAt) {
|
|
14494
|
+
const settledAt = this.#now();
|
|
14239
14495
|
const shared = {
|
|
14240
14496
|
workflowId: invocation.workflowId,
|
|
14241
14497
|
steps,
|
|
14242
|
-
durationMs:
|
|
14498
|
+
durationMs: settledAt - startedAt,
|
|
14243
14499
|
...(dependencies.length > 0 ? {
|
|
14244
14500
|
dependencies
|
|
14245
14501
|
} : {})
|
|
14246
14502
|
};
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
14257
|
-
|
|
14258
|
-
};
|
|
14259
|
-
}
|
|
14260
|
-
return {
|
|
14503
|
+
const result = outcome.kind === 'transferred' ? {
|
|
14504
|
+
...shared,
|
|
14505
|
+
outputs: {},
|
|
14506
|
+
status: 'transferred',
|
|
14507
|
+
// computed once, here, rather than left for a caller to chase via
|
|
14508
|
+
// `settledResult` — `transferredTo` already carries its own
|
|
14509
|
+
// `settledStatus`, itself computed the same way when it was built,
|
|
14510
|
+
// so this is O(1) per hop rather than a walk of the whole chain.
|
|
14511
|
+
settledStatus: outcome.transferredTo.settledStatus,
|
|
14512
|
+
transferredTo: outcome.transferredTo
|
|
14513
|
+
} : {
|
|
14261
14514
|
...shared,
|
|
14262
14515
|
outputs: await this.#resolveWorkflowOutputs(workflow, invocation),
|
|
14263
14516
|
status: outcome.status,
|
|
14264
14517
|
settledStatus: outcome.status
|
|
14265
14518
|
};
|
|
14519
|
+
this.#events?.emit({
|
|
14520
|
+
type: 'workflow-settled',
|
|
14521
|
+
...invocation.frame,
|
|
14522
|
+
status: result.status,
|
|
14523
|
+
settledStatus: result.settledStatus,
|
|
14524
|
+
outputs: result.outputs
|
|
14525
|
+
}, settledAt);
|
|
14526
|
+
return result;
|
|
14266
14527
|
}
|
|
14267
14528
|
|
|
14268
14529
|
/**
|
|
@@ -14285,10 +14546,10 @@ class WorkflowExecutor {
|
|
|
14285
14546
|
*/
|
|
14286
14547
|
#chargeBudget(scope, invocation, stepId) {
|
|
14287
14548
|
if (++scope.budget.spent <= this.#maxSteps) return;
|
|
14288
|
-
throw new
|
|
14549
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`workflow "${invocation.workflowId}" exceeded its budget of ${this.#maxSteps} step attempts (a goto loop, excessive retries, or runaway sub-workflow calls)`, {
|
|
14289
14550
|
workflowId: invocation.workflowId,
|
|
14290
14551
|
stepId,
|
|
14291
|
-
reason:
|
|
14552
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].StepBudget,
|
|
14292
14553
|
path: invocation.callStack.path
|
|
14293
14554
|
});
|
|
14294
14555
|
}
|
|
@@ -14310,17 +14571,17 @@ class WorkflowExecutor {
|
|
|
14310
14571
|
workflowId,
|
|
14311
14572
|
callStack
|
|
14312
14573
|
} = invocation;
|
|
14313
|
-
return async
|
|
14314
|
-
(0,
|
|
14574
|
+
return async attempt => {
|
|
14575
|
+
(0,_abort_ts__WEBPACK_IMPORTED_MODULE_18__.throwIfAborted)(scope.signal, {
|
|
14315
14576
|
workflowId,
|
|
14316
14577
|
stepId,
|
|
14317
14578
|
callStack
|
|
14318
14579
|
});
|
|
14319
14580
|
this.#chargeBudget(scope, invocation, stepId);
|
|
14320
14581
|
try {
|
|
14321
|
-
return await runAttempt();
|
|
14582
|
+
return await runAttempt(attempt);
|
|
14322
14583
|
} catch (error) {
|
|
14323
|
-
;(0,
|
|
14584
|
+
;(0,_abort_ts__WEBPACK_IMPORTED_MODULE_18__.throwIfAborted)(scope.signal, {
|
|
14324
14585
|
workflowId,
|
|
14325
14586
|
stepId,
|
|
14326
14587
|
callStack
|
|
@@ -14330,6 +14591,46 @@ class WorkflowExecutor {
|
|
|
14330
14591
|
};
|
|
14331
14592
|
}
|
|
14332
14593
|
|
|
14594
|
+
/**
|
|
14595
|
+
* Wraps a step-attempt thunk with the events of an attempt: `step-attempt`
|
|
14596
|
+
* as it begins, then a `criterion-evaluated` for each criterion it
|
|
14597
|
+
* evaluated, success criteria first.
|
|
14598
|
+
*/
|
|
14599
|
+
#observedAttempt(runAttempt, stepFrame) {
|
|
14600
|
+
const events = this.#events;
|
|
14601
|
+
if (events === undefined) return runAttempt;
|
|
14602
|
+
return async attempt => {
|
|
14603
|
+
const attemptFrame = {
|
|
14604
|
+
...stepFrame,
|
|
14605
|
+
attempt
|
|
14606
|
+
};
|
|
14607
|
+
events.emit({
|
|
14608
|
+
type: 'step-attempt',
|
|
14609
|
+
...attemptFrame
|
|
14610
|
+
});
|
|
14611
|
+
const outcome = await runAttempt();
|
|
14612
|
+
for (const criterion of outcome.successCriteria) {
|
|
14613
|
+
events.emit({
|
|
14614
|
+
type: 'criterion-evaluated',
|
|
14615
|
+
...attemptFrame,
|
|
14616
|
+
kind: 'success',
|
|
14617
|
+
criterion,
|
|
14618
|
+
location: criterion.location
|
|
14619
|
+
});
|
|
14620
|
+
}
|
|
14621
|
+
for (const criterion of outcome.actionCriteria) {
|
|
14622
|
+
events.emit({
|
|
14623
|
+
type: 'criterion-evaluated',
|
|
14624
|
+
...attemptFrame,
|
|
14625
|
+
kind: 'action',
|
|
14626
|
+
criterion,
|
|
14627
|
+
location: criterion.location
|
|
14628
|
+
});
|
|
14629
|
+
}
|
|
14630
|
+
return outcome;
|
|
14631
|
+
};
|
|
14632
|
+
}
|
|
14633
|
+
|
|
14333
14634
|
/**
|
|
14334
14635
|
* Builds the {@link StepRetryRunContext.runReference} callback a `retry`
|
|
14335
14636
|
* action's `stepId` / `workflowId` reference is run through.
|
|
@@ -14373,14 +14674,17 @@ class WorkflowExecutor {
|
|
|
14373
14674
|
* reference's *completion*, not its success, and a retry that turns out
|
|
14374
14675
|
* futile is bounded by `retryLimit` regardless.
|
|
14375
14676
|
*/
|
|
14376
|
-
#retryReference(steps,
|
|
14677
|
+
#retryReference(steps, stepFrame, invocation, scope, retryReferences) {
|
|
14377
14678
|
const {
|
|
14378
14679
|
workflowId,
|
|
14379
14680
|
state,
|
|
14380
14681
|
callStack
|
|
14381
14682
|
} = invocation;
|
|
14382
|
-
|
|
14383
|
-
|
|
14683
|
+
const {
|
|
14684
|
+
stepId
|
|
14685
|
+
} = stepFrame;
|
|
14686
|
+
return async (action, outcome, attempt) => {
|
|
14687
|
+
(0,_abort_ts__WEBPACK_IMPORTED_MODULE_18__.throwIfAborted)(scope.signal, {
|
|
14384
14688
|
workflowId,
|
|
14385
14689
|
stepId,
|
|
14386
14690
|
callStack
|
|
@@ -14388,12 +14692,12 @@ class WorkflowExecutor {
|
|
|
14388
14692
|
const {
|
|
14389
14693
|
hasStepId,
|
|
14390
14694
|
hasWorkflowId
|
|
14391
|
-
} = (0,
|
|
14695
|
+
} = (0,_StepTransitionInterpreter_ts__WEBPACK_IMPORTED_MODULE_15__.actionTargets)(action);
|
|
14392
14696
|
if (hasWorkflowId && hasStepId) {
|
|
14393
|
-
throw new
|
|
14697
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`retry action on step "${stepId}" in workflow "${workflowId}" declares both a stepId and a workflowId (mutually exclusive)`, {
|
|
14394
14698
|
stepId,
|
|
14395
14699
|
workflowId,
|
|
14396
|
-
reason:
|
|
14700
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].AmbiguousTarget
|
|
14397
14701
|
});
|
|
14398
14702
|
}
|
|
14399
14703
|
if (hasWorkflowId) {
|
|
@@ -14402,6 +14706,17 @@ class WorkflowExecutor {
|
|
|
14402
14706
|
// costs no budget unit.
|
|
14403
14707
|
const inputs = await this.#actionInputs(action.parameters, outcome, invocation, stepId);
|
|
14404
14708
|
this.#chargeBudget(scope, invocation, stepId);
|
|
14709
|
+
const referenceFrame = {
|
|
14710
|
+
...stepFrame,
|
|
14711
|
+
attempt,
|
|
14712
|
+
kind: 'workflow',
|
|
14713
|
+
id: reference
|
|
14714
|
+
};
|
|
14715
|
+
this.#events?.emit({
|
|
14716
|
+
type: 'retry-reference-start',
|
|
14717
|
+
...referenceFrame,
|
|
14718
|
+
location: invocation.document.locationOf(action)
|
|
14719
|
+
});
|
|
14405
14720
|
const result = await this.#runReferencedWorkflow(reference, stepId, invocation, scope, 'retry', inputs);
|
|
14406
14721
|
// the result's workflowId is the bare id the reference resolved to —
|
|
14407
14722
|
// the key run state is recorded under, whichever document owns it.
|
|
@@ -14410,22 +14725,44 @@ class WorkflowExecutor {
|
|
|
14410
14725
|
inputs: action.hasKey('parameters') ? inputs : state.getWorkflow(refId)?.inputs ?? {},
|
|
14411
14726
|
outputs: result.outputs
|
|
14412
14727
|
});
|
|
14728
|
+
const successful = !this.#settledFailed(result);
|
|
14413
14729
|
retryReferences.push({
|
|
14414
14730
|
kind: 'workflow',
|
|
14415
14731
|
id: reference,
|
|
14416
|
-
successful
|
|
14732
|
+
successful,
|
|
14417
14733
|
subWorkflow: result
|
|
14418
14734
|
});
|
|
14735
|
+
this.#events?.emit({
|
|
14736
|
+
type: 'retry-reference-settled',
|
|
14737
|
+
...referenceFrame,
|
|
14738
|
+
successful
|
|
14739
|
+
});
|
|
14419
14740
|
return;
|
|
14420
14741
|
}
|
|
14421
14742
|
const refStepId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(action.stepId);
|
|
14422
14743
|
const refIndex = this.#interpreter.indexOfStep(steps, refStepId, workflowId, {
|
|
14423
|
-
reason:
|
|
14744
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].RetryTargetNotFound,
|
|
14424
14745
|
label: 'retry reference'
|
|
14425
14746
|
});
|
|
14426
14747
|
const refStep = steps[refIndex];
|
|
14427
14748
|
const refSubWorkflows = [];
|
|
14428
|
-
const
|
|
14749
|
+
const referenceFrame = {
|
|
14750
|
+
...stepFrame,
|
|
14751
|
+
attempt,
|
|
14752
|
+
kind: 'step',
|
|
14753
|
+
id: refStepId
|
|
14754
|
+
};
|
|
14755
|
+
this.#events?.emit({
|
|
14756
|
+
type: 'retry-reference-start',
|
|
14757
|
+
...referenceFrame,
|
|
14758
|
+
location: invocation.document.locationOf(action)
|
|
14759
|
+
});
|
|
14760
|
+
// the referenced step's attempt is observed like any other, under its
|
|
14761
|
+
// own stepId and with a count of its own.
|
|
14762
|
+
const refOutcome = await this.#chargedAttempt(this.#observedAttempt(this.#stepAttempt(refStep, refStepId, invocation, scope, refSubWorkflows), {
|
|
14763
|
+
...stepFrame,
|
|
14764
|
+
stepId: refStepId
|
|
14765
|
+
}), invocation, scope, refStepId)(1);
|
|
14429
14766
|
state.setStepOutputs(refOutcome.stepId, refOutcome.outputs);
|
|
14430
14767
|
retryReferences.push({
|
|
14431
14768
|
kind: 'step',
|
|
@@ -14435,6 +14772,11 @@ class WorkflowExecutor {
|
|
|
14435
14772
|
subWorkflow: refSubWorkflows[0]
|
|
14436
14773
|
} : {})
|
|
14437
14774
|
});
|
|
14775
|
+
this.#events?.emit({
|
|
14776
|
+
type: 'retry-reference-settled',
|
|
14777
|
+
...referenceFrame,
|
|
14778
|
+
successful: refOutcome.successful
|
|
14779
|
+
});
|
|
14438
14780
|
};
|
|
14439
14781
|
}
|
|
14440
14782
|
|
|
@@ -14476,9 +14818,23 @@ class WorkflowExecutor {
|
|
|
14476
14818
|
// found halfway down the list would otherwise be raised only after earlier
|
|
14477
14819
|
// prerequisites had already fired live requests.
|
|
14478
14820
|
const dependencyRefs = await this.#dependencyRefs(workflow, invocation);
|
|
14821
|
+
const {
|
|
14822
|
+
frame
|
|
14823
|
+
} = invocation;
|
|
14479
14824
|
const results = [];
|
|
14480
14825
|
for (const dependency of dependencyRefs) {
|
|
14481
14826
|
const qualifiedId = this.#qualifiedId(dependency.locator);
|
|
14827
|
+
const target = {
|
|
14828
|
+
reference: dependency.inputsKey,
|
|
14829
|
+
workflowId: dependency.locator.workflowId,
|
|
14830
|
+
documentURI: dependency.locator.document.uri
|
|
14831
|
+
};
|
|
14832
|
+
this.#events?.emit({
|
|
14833
|
+
type: 'dependency-start',
|
|
14834
|
+
...frame,
|
|
14835
|
+
dependency: target,
|
|
14836
|
+
location: invocation.document.locationOf(dependency.entry)
|
|
14837
|
+
});
|
|
14482
14838
|
// a dependency already completed in this run is satisfied, not repeated: a
|
|
14483
14839
|
// precondition holds once met, and a diamond (two dependents sharing one
|
|
14484
14840
|
// dependency) must not duplicate its live side effects. Every dependent
|
|
@@ -14501,6 +14857,13 @@ class WorkflowExecutor {
|
|
|
14501
14857
|
inputs,
|
|
14502
14858
|
outputs: result.outputs
|
|
14503
14859
|
});
|
|
14860
|
+
this.#events?.emit({
|
|
14861
|
+
type: 'dependency-settled',
|
|
14862
|
+
...frame,
|
|
14863
|
+
dependency: target,
|
|
14864
|
+
memoized: memoized !== undefined,
|
|
14865
|
+
settledStatus: result.settledStatus
|
|
14866
|
+
});
|
|
14504
14867
|
if (this.#settledFailed(result)) return results;
|
|
14505
14868
|
|
|
14506
14869
|
// only a dependency whose chain settled non-`failed` is remembered as
|
|
@@ -14536,29 +14899,31 @@ class WorkflowExecutor {
|
|
|
14536
14899
|
document
|
|
14537
14900
|
} = invocation;
|
|
14538
14901
|
const dependsOn = workflow.dependsOn;
|
|
14539
|
-
if (!(0,
|
|
14540
|
-
throw new
|
|
14902
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isArrayElement)(dependsOn)) {
|
|
14903
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`workflow "${workflowId}" has a non-list "dependsOn"`, {
|
|
14541
14904
|
workflowId,
|
|
14542
|
-
reason:
|
|
14905
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].MalformedDependsOn
|
|
14543
14906
|
});
|
|
14544
14907
|
}
|
|
14545
|
-
const
|
|
14546
|
-
if (!(0,
|
|
14547
|
-
throw new
|
|
14908
|
+
const entries = [...dependsOn].map((entry, index) => {
|
|
14909
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(entry)) {
|
|
14910
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`workflow "${workflowId}" has a non-string entry at dependsOn[${index}]`, {
|
|
14548
14911
|
workflowId,
|
|
14549
|
-
reason:
|
|
14912
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].MalformedDependsOn
|
|
14550
14913
|
});
|
|
14551
14914
|
}
|
|
14552
|
-
return
|
|
14915
|
+
return entry;
|
|
14553
14916
|
});
|
|
14554
14917
|
const refs = [];
|
|
14555
|
-
for (const
|
|
14918
|
+
for (const entry of entries) {
|
|
14919
|
+
const reference = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(entry);
|
|
14556
14920
|
const locator = await this.#workflowLocatorNormalizer.normalize(reference, document, {
|
|
14557
14921
|
workflowId
|
|
14558
14922
|
});
|
|
14559
14923
|
refs.push({
|
|
14560
14924
|
locator,
|
|
14561
|
-
inputsKey: reference
|
|
14925
|
+
inputsKey: reference,
|
|
14926
|
+
entry
|
|
14562
14927
|
});
|
|
14563
14928
|
}
|
|
14564
14929
|
return refs;
|
|
@@ -14587,7 +14952,7 @@ class WorkflowExecutor {
|
|
|
14587
14952
|
state,
|
|
14588
14953
|
callStack
|
|
14589
14954
|
} = invocation;
|
|
14590
|
-
if (!(0,
|
|
14955
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(step.workflowId)) {
|
|
14591
14956
|
return () => this.#stepExecutor.forDocument(document).execute(step, state, scope.executeOptions, workflowId);
|
|
14592
14957
|
}
|
|
14593
14958
|
const reference = this.#subWorkflowReference(step, stepId, workflowId);
|
|
@@ -14727,12 +15092,12 @@ class WorkflowExecutor {
|
|
|
14727
15092
|
// the same check, but a sub-workflow step never reaches it — so both read
|
|
14728
15093
|
// the one list of target fields, and a target added to the specification
|
|
14729
15094
|
// cannot be rejected by one and silently accepted by the other.
|
|
14730
|
-
const conflicting =
|
|
15095
|
+
const conflicting = _StepExecutor_ts__WEBPACK_IMPORTED_MODULE_11__.STEP_TARGET_FIELDS.filter(field => field !== 'workflowId' && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(step[field]));
|
|
14731
15096
|
if (conflicting.length > 0) {
|
|
14732
|
-
throw new
|
|
15097
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`step "${stepId}" in workflow "${workflowId}" declares a workflowId alongside ${conflicting.join(', ')} (mutually exclusive)`, {
|
|
14733
15098
|
stepId,
|
|
14734
15099
|
workflowId,
|
|
14735
|
-
reason:
|
|
15100
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].AmbiguousTarget
|
|
14736
15101
|
});
|
|
14737
15102
|
}
|
|
14738
15103
|
return (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(step.workflowId);
|
|
@@ -14801,9 +15166,9 @@ class WorkflowExecutor {
|
|
|
14801
15166
|
#assertActionParameters(lists, workflowId, stepId) {
|
|
14802
15167
|
const owner = stepId === undefined ? `workflow "${workflowId}"` : `step "${stepId}" in workflow "${workflowId}"`;
|
|
14803
15168
|
for (const actions of lists) {
|
|
14804
|
-
if (!(0,
|
|
15169
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isArrayElement)(actions)) continue;
|
|
14805
15170
|
for (const action of actions) {
|
|
14806
|
-
if (!(0,
|
|
15171
|
+
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isSuccessActionElement)(action) && !(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isFailureActionElement)(action)) continue;
|
|
14807
15172
|
if (!action.hasKey('parameters')) continue;
|
|
14808
15173
|
const scope = {
|
|
14809
15174
|
workflowId,
|
|
@@ -14815,17 +15180,17 @@ class WorkflowExecutor {
|
|
|
14815
15180
|
const {
|
|
14816
15181
|
parameters
|
|
14817
15182
|
} = action;
|
|
14818
|
-
if (!(0,
|
|
14819
|
-
throw new
|
|
15183
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isArrayElement)(parameters)) {
|
|
15184
|
+
throw new _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_17__["default"]('`parameters` is present but is not a list', {
|
|
14820
15185
|
...scope,
|
|
14821
|
-
reason:
|
|
15186
|
+
reason: _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].MalformedParameters
|
|
14822
15187
|
});
|
|
14823
15188
|
}
|
|
14824
|
-
const inline = [...parameters].some(parameter => (0,
|
|
15189
|
+
const inline = [...parameters].some(parameter => (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isParameterElement)(parameter) && parameter.hasKey('in') && !parameter.meta.hasKey('ref-fields'));
|
|
14825
15190
|
if (inline) {
|
|
14826
|
-
throw new
|
|
15191
|
+
throw new _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`An action parameter of ${owner} declares an \`in\`; action parameters map to the target workflow's inputs by name`, {
|
|
14827
15192
|
...scope,
|
|
14828
|
-
reason:
|
|
15193
|
+
reason: _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].ActionParameterLocation
|
|
14829
15194
|
});
|
|
14830
15195
|
}
|
|
14831
15196
|
}
|
|
@@ -14833,30 +15198,46 @@ class WorkflowExecutor {
|
|
|
14833
15198
|
}
|
|
14834
15199
|
|
|
14835
15200
|
/**
|
|
14836
|
-
* Extracts
|
|
14837
|
-
*
|
|
14838
|
-
*
|
|
14839
|
-
*
|
|
14840
|
-
*
|
|
14841
|
-
*
|
|
14842
|
-
*
|
|
14843
|
-
* missing id itself.
|
|
15201
|
+
* Extracts the workflow a locator names. A workflow its document does not
|
|
15202
|
+
* define is the executor-level `workflow-not-found` authoring error, raised
|
|
15203
|
+
* here rather than leaking the extractor's `ExtractionError`. Only the root
|
|
15204
|
+
* {@link WorkflowExecutor.execute} id reaches this check unvalidated — every
|
|
15205
|
+
* reference position goes through the locator normalizer, which already
|
|
15206
|
+
* rejects a missing workflow with the referencing context attached — so the
|
|
15207
|
+
* error's `workflowId` is the missing id itself.
|
|
14844
15208
|
*/
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
} = locator;
|
|
14850
|
-
const qualifiedId = this.#qualifiedId(locator);
|
|
14851
|
-
const cached = scope.workflows.get(qualifiedId);
|
|
14852
|
-
if (cached !== undefined) return cached;
|
|
15209
|
+
#extractWorkflow({
|
|
15210
|
+
document,
|
|
15211
|
+
workflowId
|
|
15212
|
+
}) {
|
|
14853
15213
|
if (!document.workflowIndex.has(workflowId)) {
|
|
14854
|
-
throw new
|
|
15214
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`workflow "${workflowId}" not found in Arazzo document at "${document.uri}"`, {
|
|
14855
15215
|
workflowId,
|
|
14856
|
-
reason:
|
|
15216
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].WorkflowNotFound
|
|
14857
15217
|
});
|
|
14858
15218
|
}
|
|
14859
|
-
|
|
15219
|
+
return this.#extractor.extract(document, workflowId);
|
|
15220
|
+
}
|
|
15221
|
+
|
|
15222
|
+
/**
|
|
15223
|
+
* Normalizes an extracted workflow, once per run for each workflow.
|
|
15224
|
+
*/
|
|
15225
|
+
async #resolveWorkflow(locator, extracted, scope, frame) {
|
|
15226
|
+
const qualifiedId = this.#qualifiedId(locator);
|
|
15227
|
+
const cached = scope.workflows.get(qualifiedId);
|
|
15228
|
+
if (cached !== undefined) return cached;
|
|
15229
|
+
const location = locator.document.locationOf(extracted);
|
|
15230
|
+
this.#events?.emit({
|
|
15231
|
+
type: 'workflow-normalize-start',
|
|
15232
|
+
...frame,
|
|
15233
|
+
location
|
|
15234
|
+
});
|
|
15235
|
+
const workflow = await this.#normalizer.normalize(extracted, locator.document);
|
|
15236
|
+
this.#events?.emit({
|
|
15237
|
+
type: 'workflow-normalize-settled',
|
|
15238
|
+
...frame,
|
|
15239
|
+
location
|
|
15240
|
+
});
|
|
14860
15241
|
scope.workflows.set(qualifiedId, workflow);
|
|
14861
15242
|
return workflow;
|
|
14862
15243
|
}
|
|
@@ -14881,17 +15262,17 @@ class WorkflowExecutor {
|
|
|
14881
15262
|
#orderedSteps(workflow, workflowId) {
|
|
14882
15263
|
if (!workflow.hasKey('steps')) return [];
|
|
14883
15264
|
const steps = workflow.steps;
|
|
14884
|
-
if (!(0,
|
|
14885
|
-
throw new
|
|
15265
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isArrayElement)(steps)) {
|
|
15266
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`workflow "${workflowId}" has a non-list "steps"`, {
|
|
14886
15267
|
workflowId,
|
|
14887
|
-
reason:
|
|
15268
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].MalformedSteps
|
|
14888
15269
|
});
|
|
14889
15270
|
}
|
|
14890
15271
|
return [...steps].map((step, index) => {
|
|
14891
|
-
if (!(0,
|
|
14892
|
-
throw new
|
|
15272
|
+
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isStepElement)(step)) {
|
|
15273
|
+
throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"](`workflow "${workflowId}" has a non-step entry at steps[${index}]`, {
|
|
14893
15274
|
workflowId,
|
|
14894
|
-
reason:
|
|
15275
|
+
reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_16__["default"].MalformedSteps
|
|
14895
15276
|
});
|
|
14896
15277
|
}
|
|
14897
15278
|
return step;
|
|
@@ -14910,11 +15291,11 @@ class WorkflowExecutor {
|
|
|
14910
15291
|
#validateWorkflowOutputsShape(workflow, workflowId) {
|
|
14911
15292
|
if (!workflow.hasKey('outputs')) return;
|
|
14912
15293
|
const outputs = workflow.outputs;
|
|
14913
|
-
if ((0,
|
|
14914
|
-
throw new
|
|
15294
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isObjectElement)(outputs)) return;
|
|
15295
|
+
throw new _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_17__["default"]('`outputs` is present but is not a map', {
|
|
14915
15296
|
workflowId,
|
|
14916
15297
|
target: 'outputs',
|
|
14917
|
-
reason:
|
|
15298
|
+
reason: _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].MalformedOutputs
|
|
14918
15299
|
});
|
|
14919
15300
|
}
|
|
14920
15301
|
|
|
@@ -14937,7 +15318,7 @@ class WorkflowExecutor {
|
|
|
14937
15318
|
* counterpart of {@link StepExecutor}'s bridge.
|
|
14938
15319
|
*/
|
|
14939
15320
|
#evaluate(context, expression, document) {
|
|
14940
|
-
return new
|
|
15321
|
+
return new _expression_RuntimeExpressionEvaluator_ts__WEBPACK_IMPORTED_MODULE_5__["default"](context, {
|
|
14941
15322
|
strict: false,
|
|
14942
15323
|
document,
|
|
14943
15324
|
registry: this.#registry
|
|
@@ -16438,6 +16819,335 @@ class OpenAPIOperationNormalizer {
|
|
|
16438
16819
|
/* harmony export */ ]);
|
|
16439
16820
|
|
|
16440
16821
|
|
|
16822
|
+
/***/ },
|
|
16823
|
+
|
|
16824
|
+
/***/ 12993
|
|
16825
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
16826
|
+
|
|
16827
|
+
"use strict";
|
|
16828
|
+
__webpack_require__.r(__webpack_exports__);
|
|
16829
|
+
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34606);
|
|
16830
|
+
|
|
16831
|
+
|
|
16832
|
+
/**
|
|
16833
|
+
* An event without its `timestamp`, which the channel stamps. Distributes over
|
|
16834
|
+
* a union, so each member keeps its own discriminated shape.
|
|
16835
|
+
* @internal
|
|
16836
|
+
*/
|
|
16837
|
+
|
|
16838
|
+
/**
|
|
16839
|
+
* Options for the EventChannel.
|
|
16840
|
+
* @internal
|
|
16841
|
+
*/
|
|
16842
|
+
|
|
16843
|
+
/**
|
|
16844
|
+
* Delivers a building block's events to its observer: stamps each with the
|
|
16845
|
+
* block's clock, snapshots it, and hands it over synchronously, without
|
|
16846
|
+
* awaiting anything.
|
|
16847
|
+
*
|
|
16848
|
+
* A block holds a channel only when it was given an observer (see
|
|
16849
|
+
* {@link EventChannel.open}), and emits through `this.#events?.emit(...)`: with
|
|
16850
|
+
* no channel, optional chaining skips evaluating the event too, so an
|
|
16851
|
+
* unobserved run builds no events at all.
|
|
16852
|
+
* @internal
|
|
16853
|
+
*/
|
|
16854
|
+
class EventChannel {
|
|
16855
|
+
static #DEFAULT_NOW = () => performance.now();
|
|
16856
|
+
|
|
16857
|
+
/**
|
|
16858
|
+
* A channel to `options.observer`, or `undefined` when there is none.
|
|
16859
|
+
*/
|
|
16860
|
+
static open(options) {
|
|
16861
|
+
const {
|
|
16862
|
+
observer,
|
|
16863
|
+
now
|
|
16864
|
+
} = options;
|
|
16865
|
+
return observer === undefined ? undefined : new EventChannel({
|
|
16866
|
+
observer,
|
|
16867
|
+
now
|
|
16868
|
+
});
|
|
16869
|
+
}
|
|
16870
|
+
|
|
16871
|
+
/**
|
|
16872
|
+
* A frozen deep copy of the plain objects and arrays in `value`; anything
|
|
16873
|
+
* else, an ApiDOM element above all, is shared as it is. The run keeps
|
|
16874
|
+
* using the objects an event describes (the trace's records, the outputs,
|
|
16875
|
+
* the context a request interceptor receives, the transition it acts on),
|
|
16876
|
+
* so handing out the originals would let an observer change the run.
|
|
16877
|
+
*/
|
|
16878
|
+
static #snapshot(value, copies) {
|
|
16879
|
+
if (!Array.isArray(value) && !(0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) return value;
|
|
16880
|
+
const seen = copies.get(value);
|
|
16881
|
+
if (seen !== undefined) return seen;
|
|
16882
|
+
const copy = Array.isArray(value) ? [] : {};
|
|
16883
|
+
copies.set(value, copy);
|
|
16884
|
+
for (const [key, item] of Object.entries(value)) {
|
|
16885
|
+
// defined, not assigned: assigning an own `__proto__` key (JSON.parse
|
|
16886
|
+
// makes one) would set the copy's prototype instead of copying it.
|
|
16887
|
+
Object.defineProperty(copy, key, {
|
|
16888
|
+
value: EventChannel.#snapshot(item, copies),
|
|
16889
|
+
enumerable: true,
|
|
16890
|
+
writable: true,
|
|
16891
|
+
configurable: true
|
|
16892
|
+
});
|
|
16893
|
+
}
|
|
16894
|
+
return Object.freeze(copy);
|
|
16895
|
+
}
|
|
16896
|
+
#observer;
|
|
16897
|
+
#now;
|
|
16898
|
+
constructor(options) {
|
|
16899
|
+
this.#observer = options.observer;
|
|
16900
|
+
this.#now = options.now ?? EventChannel.#DEFAULT_NOW;
|
|
16901
|
+
}
|
|
16902
|
+
|
|
16903
|
+
/**
|
|
16904
|
+
* Emits the event. `timestamp` is the clock reading the event describes,
|
|
16905
|
+
* when the caller already took one (so a start/settled pair matches a
|
|
16906
|
+
* recorded duration exactly); otherwise the clock is read now.
|
|
16907
|
+
*/
|
|
16908
|
+
emit(event, timestamp) {
|
|
16909
|
+
// an absent optional field of the event itself is omitted, never present as
|
|
16910
|
+
// undefined; undefined values inside its data (an output that resolved to
|
|
16911
|
+
// undefined) are kept.
|
|
16912
|
+
const fields = Object.entries(event).filter(([, value]) => value !== undefined);
|
|
16913
|
+
const stamped = {
|
|
16914
|
+
...Object.fromEntries(fields),
|
|
16915
|
+
timestamp: timestamp ?? this.#now()
|
|
16916
|
+
};
|
|
16917
|
+
this.#observer(EventChannel.#snapshot(stamped, new WeakMap()));
|
|
16918
|
+
}
|
|
16919
|
+
}
|
|
16920
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EventChannel);
|
|
16921
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
16922
|
+
/* harmony export */ "default", 0, __WEBPACK_DEFAULT_EXPORT__
|
|
16923
|
+
/* harmony export */ ]);
|
|
16924
|
+
|
|
16925
|
+
|
|
16926
|
+
/***/ },
|
|
16927
|
+
|
|
16928
|
+
/***/ 4050
|
|
16929
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
16930
|
+
|
|
16931
|
+
"use strict";
|
|
16932
|
+
__webpack_require__.r(__webpack_exports__);
|
|
16933
|
+
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34606);
|
|
16934
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62823);
|
|
16935
|
+
/* harmony import */ var _swaggerexpert_arazzo_runtime_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26847);
|
|
16936
|
+
/* harmony import */ var _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(61198);
|
|
16937
|
+
/* harmony import */ var _swaggerexpert_media_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93504);
|
|
16938
|
+
|
|
16939
|
+
|
|
16940
|
+
|
|
16941
|
+
|
|
16942
|
+
|
|
16943
|
+
|
|
16944
|
+
/**
|
|
16945
|
+
* The parts of a parsed runtime expression that name what it reads.
|
|
16946
|
+
*/
|
|
16947
|
+
|
|
16948
|
+
/**
|
|
16949
|
+
* A parsed media type, lowercased by the parser.
|
|
16950
|
+
*/
|
|
16951
|
+
|
|
16952
|
+
/**
|
|
16953
|
+
* Options for the Redactor.
|
|
16954
|
+
* @public
|
|
16955
|
+
*/
|
|
16956
|
+
|
|
16957
|
+
/**
|
|
16958
|
+
* Masks credentials in events before they leave the process.
|
|
16959
|
+
*
|
|
16960
|
+
* Events carry what the run saw, credentials included, like the request a
|
|
16961
|
+
* request interceptor receives. Pass every event through
|
|
16962
|
+
* {@link Redactor.event} before logging, exporting or writing it.
|
|
16963
|
+
*
|
|
16964
|
+
* It masks by name, whatever the event:
|
|
16965
|
+
*
|
|
16966
|
+
* - the value of any field whose name matches a pattern: headers, query
|
|
16967
|
+
* parameters, body and output fields, at any depth;
|
|
16968
|
+
* - a criterion value whose runtime expression reads a matching name, in its
|
|
16969
|
+
* base or in any token of its JSON Pointer (`$inputs.password`,
|
|
16970
|
+
* `$steps.login.outputs.token#/value`);
|
|
16971
|
+
* - in every absolute URL, as `URL` parses it, the userinfo and the matching
|
|
16972
|
+
* query and fragment parameters;
|
|
16973
|
+
* - a request or response body that is JSON or a URL-encoded form, field by
|
|
16974
|
+
* field, and any other body, or any object that is not plain data, whole.
|
|
16975
|
+
*
|
|
16976
|
+
* A credential under a name no pattern matches is carried as it is. The
|
|
16977
|
+
* masked value is `REDACTED`.
|
|
16978
|
+
* @public
|
|
16979
|
+
*/
|
|
16980
|
+
class Redactor {
|
|
16981
|
+
static CENSOR = 'REDACTED';
|
|
16982
|
+
|
|
16983
|
+
/**
|
|
16984
|
+
* Elastic APM's `sanitizeFieldNames` defaults, with `*secret*` for its exact
|
|
16985
|
+
* `secret` (which misses OAuth's `client_secret`), plus the signed-URL query
|
|
16986
|
+
* parameters OpenTelemetry's HTTP conventions mask.
|
|
16987
|
+
*/
|
|
16988
|
+
static defaultFields = Object.freeze(['password', 'passwd', 'pwd', '*secret*', '*key', '*token*', '*session*', '*credit*', '*card*', '*auth*', 'set-cookie', '*principal*', 'pw', 'pass', 'connect.sid', 'cookie', 'AWSAccessKeyId', 'Signature', 'sig', 'X-Goog-Signature']);
|
|
16989
|
+
#patterns;
|
|
16990
|
+
#matches = new Map();
|
|
16991
|
+
constructor(options = {}) {
|
|
16992
|
+
this.#patterns = (options.fields ?? Redactor.defaultFields).map(Redactor.#compile);
|
|
16993
|
+
}
|
|
16994
|
+
|
|
16995
|
+
/**
|
|
16996
|
+
* A masked copy of the event.
|
|
16997
|
+
*/
|
|
16998
|
+
event(event) {
|
|
16999
|
+
return this.#walk(event, new WeakSet());
|
|
17000
|
+
}
|
|
17001
|
+
#walk(value, seen) {
|
|
17002
|
+
if (typeof value === 'string') return URL.canParse(value) ? this.#url(value) : value;
|
|
17003
|
+
if (typeof value !== 'object' || value === null) return value;
|
|
17004
|
+
// an ApiDOM element (a selected action) is the document's own, and a date
|
|
17005
|
+
// holds no credential; any other object that is not plain data cannot be
|
|
17006
|
+
// walked field by field.
|
|
17007
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(value) || value instanceof Date) return value;
|
|
17008
|
+
if (!Array.isArray(value) && !(0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) return Redactor.CENSOR;
|
|
17009
|
+
// only the objects on the current path: a shared, acyclic one is walked
|
|
17010
|
+
// again where it reappears, a cycle is cut.
|
|
17011
|
+
if (seen.has(value)) return Redactor.CENSOR;
|
|
17012
|
+
seen.add(value);
|
|
17013
|
+
try {
|
|
17014
|
+
return Array.isArray(value) ? value.map(item => this.#walk(item, seen)) : this.#fields(value, seen);
|
|
17015
|
+
} finally {
|
|
17016
|
+
seen.delete(value);
|
|
17017
|
+
}
|
|
17018
|
+
}
|
|
17019
|
+
#fields(object, seen) {
|
|
17020
|
+
const redacted = {};
|
|
17021
|
+
for (const [name, item] of Object.entries(object)) {
|
|
17022
|
+
let masked;
|
|
17023
|
+
if (this.#masks(name)) masked = Redactor.CENSOR;else if (name === 'body' && (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(object.headers)) {
|
|
17024
|
+
masked = this.#body(item, object.headers, seen);
|
|
17025
|
+
} else masked = this.#walk(item, seen);
|
|
17026
|
+
// defined, not assigned, so an own `__proto__` key stays data
|
|
17027
|
+
Object.defineProperty(redacted, name, {
|
|
17028
|
+
value: masked,
|
|
17029
|
+
enumerable: true,
|
|
17030
|
+
writable: true,
|
|
17031
|
+
configurable: true
|
|
17032
|
+
});
|
|
17033
|
+
}
|
|
17034
|
+
return redacted;
|
|
17035
|
+
}
|
|
17036
|
+
|
|
17037
|
+
/**
|
|
17038
|
+
* Whether a name matches a pattern. A runtime expression matches when any
|
|
17039
|
+
* name it reads does.
|
|
17040
|
+
*/
|
|
17041
|
+
#masks(name) {
|
|
17042
|
+
let matches = this.#matches.get(name);
|
|
17043
|
+
if (matches === undefined) {
|
|
17044
|
+
const names = name.startsWith('$') ? Redactor.#namesRead(name) : [name];
|
|
17045
|
+
matches = names.some(candidate => this.#patterns.some(pattern => pattern.test(candidate)));
|
|
17046
|
+
this.#matches.set(name, matches);
|
|
17047
|
+
}
|
|
17048
|
+
return matches;
|
|
17049
|
+
}
|
|
17050
|
+
|
|
17051
|
+
/**
|
|
17052
|
+
* The absolute URL with its userinfo and matching query and fragment
|
|
17053
|
+
* parameters masked. A URL with nothing to mask comes back exactly as it
|
|
17054
|
+
* was, not normalized.
|
|
17055
|
+
*/
|
|
17056
|
+
#url(value) {
|
|
17057
|
+
const url = new URL(value);
|
|
17058
|
+
let masked = false;
|
|
17059
|
+
if (url.username !== '' || url.password !== '') {
|
|
17060
|
+
url.username = Redactor.CENSOR;
|
|
17061
|
+
url.password = Redactor.CENSOR;
|
|
17062
|
+
masked = true;
|
|
17063
|
+
}
|
|
17064
|
+
const query = this.#params(url.search.slice(1));
|
|
17065
|
+
if (query !== undefined) {
|
|
17066
|
+
url.search = query;
|
|
17067
|
+
masked = true;
|
|
17068
|
+
}
|
|
17069
|
+
const fragment = this.#params(url.hash.slice(1));
|
|
17070
|
+
if (fragment !== undefined) {
|
|
17071
|
+
url.hash = fragment;
|
|
17072
|
+
masked = true;
|
|
17073
|
+
}
|
|
17074
|
+
return masked ? url.href : value;
|
|
17075
|
+
}
|
|
17076
|
+
|
|
17077
|
+
/**
|
|
17078
|
+
* A body masked by what its `Content-Type` says it is.
|
|
17079
|
+
*/
|
|
17080
|
+
#body(body, headers, seen) {
|
|
17081
|
+
if (typeof body !== 'string' || body === '') return this.#walk(body, seen);
|
|
17082
|
+
const mediaType = Redactor.#contentType(headers);
|
|
17083
|
+
if (mediaType?.subtype === 'json' || mediaType?.suffix === 'json') {
|
|
17084
|
+
try {
|
|
17085
|
+
return JSON.stringify(this.#walk(JSON.parse(body), seen));
|
|
17086
|
+
} catch {
|
|
17087
|
+
return Redactor.CENSOR;
|
|
17088
|
+
}
|
|
17089
|
+
}
|
|
17090
|
+
if (mediaType?.type === 'application' && mediaType.subtype === 'x-www-form-urlencoded') {
|
|
17091
|
+
return this.#params(body) ?? body;
|
|
17092
|
+
}
|
|
17093
|
+
return Redactor.CENSOR;
|
|
17094
|
+
}
|
|
17095
|
+
|
|
17096
|
+
/**
|
|
17097
|
+
* URL-encoded `name=value` pairs with matching values masked, or
|
|
17098
|
+
* `undefined` when none matches, so the caller keeps the text as it was.
|
|
17099
|
+
*/
|
|
17100
|
+
#params(text) {
|
|
17101
|
+
let masked = false;
|
|
17102
|
+
const params = [...new URLSearchParams(text)].map(([name, value]) => {
|
|
17103
|
+
if (!this.#masks(name)) return [name, value];
|
|
17104
|
+
masked = true;
|
|
17105
|
+
return [name, Redactor.CENSOR];
|
|
17106
|
+
});
|
|
17107
|
+
return masked ? new URLSearchParams(params).toString() : undefined;
|
|
17108
|
+
}
|
|
17109
|
+
static #contentType(headers) {
|
|
17110
|
+
const name = Object.keys(headers).find(key => key.toLowerCase() === 'content-type');
|
|
17111
|
+
if (name === undefined) return undefined;
|
|
17112
|
+
try {
|
|
17113
|
+
return (0,_swaggerexpert_media_types__WEBPACK_IMPORTED_MODULE_4__.parse)(headers[name], {
|
|
17114
|
+
type: 'media-type'
|
|
17115
|
+
}).tree;
|
|
17116
|
+
} catch {
|
|
17117
|
+
return undefined;
|
|
17118
|
+
}
|
|
17119
|
+
}
|
|
17120
|
+
|
|
17121
|
+
/**
|
|
17122
|
+
* Every name a runtime expression reads: the header, query, path, input,
|
|
17123
|
+
* output or component name, and each token of its JSON Pointer, e.g.
|
|
17124
|
+
* `token` and `value` for `$steps.login.outputs.token#/value`. A string
|
|
17125
|
+
* that does not parse as an expression is its own name.
|
|
17126
|
+
*/
|
|
17127
|
+
static #namesRead(expression) {
|
|
17128
|
+
let tree;
|
|
17129
|
+
try {
|
|
17130
|
+
tree = (0,_swaggerexpert_arazzo_runtime_expression__WEBPACK_IMPORTED_MODULE_2__.parse)(expression).tree;
|
|
17131
|
+
} catch {
|
|
17132
|
+
return [expression];
|
|
17133
|
+
}
|
|
17134
|
+
if (tree === undefined) return [expression];
|
|
17135
|
+
const reference = tree.source?.reference;
|
|
17136
|
+
const tokens = (tree.jsonPointer ?? reference?.jsonPointer)?.referenceTokens ?? [];
|
|
17137
|
+
const names = [reference?.token, reference?.name, tree.name, tree.outputName, tree.fieldName, tree.componentName, ...tokens.map(token => (0,_swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_3__.unescape)(token.value))];
|
|
17138
|
+
return names.filter(name => name !== undefined);
|
|
17139
|
+
}
|
|
17140
|
+
static #compile(pattern) {
|
|
17141
|
+
const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
|
|
17142
|
+
return new RegExp(`^${escaped}$`, 'i');
|
|
17143
|
+
}
|
|
17144
|
+
}
|
|
17145
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Redactor);
|
|
17146
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
17147
|
+
/* harmony export */ "default", 0, __WEBPACK_DEFAULT_EXPORT__
|
|
17148
|
+
/* harmony export */ ]);
|
|
17149
|
+
|
|
17150
|
+
|
|
16441
17151
|
/***/ },
|
|
16442
17152
|
|
|
16443
17153
|
/***/ 4044
|
|
@@ -16454,6 +17164,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16454
17164
|
/* harmony import */ var _errors_InvalidEntryDocumentError_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(40198);
|
|
16455
17165
|
/* harmony import */ var _errors_UnmatchedProviderError_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(46132);
|
|
16456
17166
|
/* harmony import */ var _constants_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(89307);
|
|
17167
|
+
/* harmony import */ var _observability_EventChannel_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(12993);
|
|
17168
|
+
|
|
16457
17169
|
|
|
16458
17170
|
|
|
16459
17171
|
|
|
@@ -16481,8 +17193,13 @@ class DocumentRegistry {
|
|
|
16481
17193
|
#documents = new Map();
|
|
16482
17194
|
#loading = new Map();
|
|
16483
17195
|
#providers;
|
|
17196
|
+
#events;
|
|
16484
17197
|
constructor(options = {}) {
|
|
16485
17198
|
this.#providers = options.providers ?? [new _providers_ArazzoDocumentRegistryProvider_ts__WEBPACK_IMPORTED_MODULE_2__["default"](), new _providers_OpenAPIDocumentRegistryProvider_ts__WEBPACK_IMPORTED_MODULE_3__["default"]()];
|
|
17199
|
+
this.#events = _observability_EventChannel_ts__WEBPACK_IMPORTED_MODULE_9__["default"].open({
|
|
17200
|
+
observer: options.observer,
|
|
17201
|
+
now: options.now
|
|
17202
|
+
});
|
|
16486
17203
|
}
|
|
16487
17204
|
|
|
16488
17205
|
/**
|
|
@@ -16528,12 +17245,15 @@ class DocumentRegistry {
|
|
|
16528
17245
|
* caches it.
|
|
16529
17246
|
*/
|
|
16530
17247
|
async #load(canonicalURI) {
|
|
17248
|
+
this.#events?.emit({
|
|
17249
|
+
type: 'document-load-start',
|
|
17250
|
+
uri: canonicalURI
|
|
17251
|
+
});
|
|
16531
17252
|
for (const provider of this.#providers) {
|
|
17253
|
+
let document;
|
|
16532
17254
|
try {
|
|
16533
17255
|
if (await provider.canProvide(canonicalURI)) {
|
|
16534
|
-
|
|
16535
|
-
this.#set(canonicalURI, document);
|
|
16536
|
-
return document;
|
|
17256
|
+
document = await provider.provide(canonicalURI);
|
|
16537
17257
|
}
|
|
16538
17258
|
} catch (error) {
|
|
16539
17259
|
// a document that cannot be read or loaded fails in ApiDOM or the parser;
|
|
@@ -16544,6 +17264,16 @@ class DocumentRegistry {
|
|
|
16544
17264
|
cause: error
|
|
16545
17265
|
});
|
|
16546
17266
|
}
|
|
17267
|
+
if (document !== undefined) {
|
|
17268
|
+
// outside the try, so an observer's own error is not a failed load, and
|
|
17269
|
+
// before caching, so a run it aborts leaves no half-registered document.
|
|
17270
|
+
this.#events?.emit({
|
|
17271
|
+
type: 'document-load-settled',
|
|
17272
|
+
uri: canonicalURI
|
|
17273
|
+
});
|
|
17274
|
+
this.#set(canonicalURI, document);
|
|
17275
|
+
return document;
|
|
17276
|
+
}
|
|
16547
17277
|
}
|
|
16548
17278
|
throw new _errors_UnmatchedProviderError_ts__WEBPACK_IMPORTED_MODULE_7__["default"](`No provider can handle the document at "${canonicalURI}"`, {
|
|
16549
17279
|
uri: canonicalURI
|
|
@@ -16763,11 +17493,13 @@ class ArazzoDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBPA
|
|
|
16763
17493
|
*/
|
|
16764
17494
|
async provide(uri) {
|
|
16765
17495
|
const parseResult = await (0,_usearazzo_parser__WEBPACK_IMPORTED_MODULE_0__.parse)(uri, this.#buildParseOptions());
|
|
17496
|
+
this.assertParsed(uri, parseResult);
|
|
16766
17497
|
const {
|
|
16767
17498
|
workflowIndex,
|
|
16768
17499
|
stepIndex,
|
|
16769
17500
|
sourceDescriptionIndex
|
|
16770
17501
|
} = this.#buildIndexes(uri, parseResult);
|
|
17502
|
+
ArazzoDocumentRegistryProvider.#recordPointers(parseResult);
|
|
16771
17503
|
return new _document_ArazzoDocument_ts__WEBPACK_IMPORTED_MODULE_11__["default"](uri, parseResult, workflowIndex, stepIndex, sourceDescriptionIndex);
|
|
16772
17504
|
}
|
|
16773
17505
|
|
|
@@ -16827,6 +17559,24 @@ class ArazzoDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBPA
|
|
|
16827
17559
|
sourceDescriptionIndex
|
|
16828
17560
|
};
|
|
16829
17561
|
}
|
|
17562
|
+
|
|
17563
|
+
/**
|
|
17564
|
+
* Records, in each element's `json-pointer` meta, where it is written: every
|
|
17565
|
+
* workflow, step, criterion and action, its `components` included, and
|
|
17566
|
+
* every `dependsOn` entry. The record travels with the element through
|
|
17567
|
+
* normalization, so an inherited or referenced element keeps the pointer of
|
|
17568
|
+
* where it is defined, for the events to locate it by.
|
|
17569
|
+
*/
|
|
17570
|
+
static #recordPointers(parseResult) {
|
|
17571
|
+
;(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverse)(parseResult.api, {
|
|
17572
|
+
enter(path) {
|
|
17573
|
+
const element = path.node;
|
|
17574
|
+
const located = (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_9__.isWorkflowElement)(element) || (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_9__.isStepElement)(element) || (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_9__.isCriterionElement)(element) || (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_9__.isSuccessActionElement)(element) || (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_9__.isFailureActionElement)(element) || (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_9__.isWorkflowDependsOnElement)(path.parentPath?.node);
|
|
17575
|
+
if (!located) return;
|
|
17576
|
+
element.meta.set('json-pointer', path.formatPath('jsonpointer'));
|
|
17577
|
+
}
|
|
17578
|
+
});
|
|
17579
|
+
}
|
|
16830
17580
|
#buildParseOptions() {
|
|
16831
17581
|
return (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_4__.merge)(_usearazzo_parser__WEBPACK_IMPORTED_MODULE_0__.defaultOptions, this.#options);
|
|
16832
17582
|
}
|
|
@@ -16846,6 +17596,10 @@ class ArazzoDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBPA
|
|
|
16846
17596
|
"use strict";
|
|
16847
17597
|
__webpack_require__.r(__webpack_exports__);
|
|
16848
17598
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32420);
|
|
17599
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7456);
|
|
17600
|
+
/* harmony import */ var _usearazzo_parser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94433);
|
|
17601
|
+
|
|
17602
|
+
|
|
16849
17603
|
|
|
16850
17604
|
/**
|
|
16851
17605
|
* Replaces circular $ref references with an empty ObjectElement
|
|
@@ -16887,6 +17641,18 @@ class DocumentRegistryProvider {
|
|
|
16887
17641
|
/**
|
|
16888
17642
|
* Loads and produces a document from a URI.
|
|
16889
17643
|
*/
|
|
17644
|
+
|
|
17645
|
+
/**
|
|
17646
|
+
* Rejects a document the parser could only partly read. The strict parsers
|
|
17647
|
+
* throw on a syntax error; the lenient ones that source maps need record it
|
|
17648
|
+
* and parse what they can instead, so a document must load with source maps
|
|
17649
|
+
* exactly when it loads without.
|
|
17650
|
+
*/
|
|
17651
|
+
assertParsed(uri, parseResult) {
|
|
17652
|
+
const [error] = parseResult.errors;
|
|
17653
|
+
if (error === undefined) return;
|
|
17654
|
+
throw new _usearazzo_parser__WEBPACK_IMPORTED_MODULE_2__["default"](`Failed to parse the document at "${uri}": ${(0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(error)}`);
|
|
17655
|
+
}
|
|
16890
17656
|
}
|
|
16891
17657
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DocumentRegistryProvider);
|
|
16892
17658
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
@@ -16989,10 +17755,11 @@ class OpenAPIDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBP
|
|
|
16989
17755
|
*/
|
|
16990
17756
|
async provide(uri) {
|
|
16991
17757
|
const parseResult = await (0,_usearazzo_parser__WEBPACK_IMPORTED_MODULE_0__.parse)(uri, this.#buildParseOptions());
|
|
16992
|
-
|
|
17758
|
+
this.assertParsed(uri, parseResult);
|
|
17759
|
+
const operationIndex = await this.#buildOperationIndex(uri, parseResult);
|
|
16993
17760
|
return new _document_OpenAPIDocument_ts__WEBPACK_IMPORTED_MODULE_10__["default"](uri, parseResult, operationIndex);
|
|
16994
17761
|
}
|
|
16995
|
-
async #buildOperationIndex(parseResult) {
|
|
17762
|
+
async #buildOperationIndex(uri, parseResult) {
|
|
16996
17763
|
const index = new _document_OpenAPIOperationIndex_ts__WEBPACK_IMPORTED_MODULE_12__["default"]();
|
|
16997
17764
|
const dereferenceOptions = this.#buildDereferenceOptions(parseResult);
|
|
16998
17765
|
const apiDereferenced = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_7__.traverseAsync)(parseResult.api, {
|
|
@@ -17000,16 +17767,37 @@ class OpenAPIDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBP
|
|
|
17000
17767
|
const pathItem = path.node;
|
|
17001
17768
|
if (!pathItem.hasMetaProperty('path')) return path.skip();
|
|
17002
17769
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(pathItem.$ref)) return;
|
|
17003
|
-
|
|
17004
|
-
|
|
17770
|
+
|
|
17771
|
+
// an operation written next to the `$ref` stays where it is written
|
|
17772
|
+
const pointer = path.formatPath('jsonpointer');
|
|
17773
|
+
pathItem.forEach((value, key) => {
|
|
17774
|
+
if (value.element !== 'operation') return;
|
|
17775
|
+
value.meta.set('json-pointer', `${pointer}/${(0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(key)}`);
|
|
17776
|
+
});
|
|
17777
|
+
path.replaceWith(await (0,_usearazzo_resolver__WEBPACK_IMPORTED_MODULE_1__.dereferenceElement)(pathItem, dereferenceOptions));
|
|
17005
17778
|
},
|
|
17006
17779
|
OperationElement(path) {
|
|
17007
17780
|
const operation = path.node;
|
|
17008
17781
|
const operationId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(operation.operationId);
|
|
17782
|
+
const pointer = path.formatPath('jsonpointer');
|
|
17783
|
+
// where the operation is written, for the events to locate it by: an
|
|
17784
|
+
// operation of a `$ref` path item is written where that path item is,
|
|
17785
|
+
// unless it was written next to the `$ref` and so already located
|
|
17786
|
+
if (!operation.hasMetaProperty('json-pointer')) {
|
|
17787
|
+
const member = path.parentPath?.node;
|
|
17788
|
+
const pathItem = path.parentPath?.parentPath?.node;
|
|
17789
|
+
const definition = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(pathItem.meta.get('ref-origin-pointer'));
|
|
17790
|
+
if (typeof definition === 'string') {
|
|
17791
|
+
operation.meta.set('ref-origin', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(pathItem.meta.get('ref-origin')));
|
|
17792
|
+
operation.meta.set('json-pointer', `${definition}/${(0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(member.key)}`);
|
|
17793
|
+
} else {
|
|
17794
|
+
operation.meta.set('json-pointer', pointer);
|
|
17795
|
+
}
|
|
17796
|
+
}
|
|
17009
17797
|
if (typeof operationId !== 'string') return path.skip();
|
|
17010
17798
|
if (operationId === '') return path.skip();
|
|
17011
17799
|
if (index.has(operationId)) return path.skip();
|
|
17012
|
-
index.set(operationId,
|
|
17800
|
+
index.set(operationId, pointer);
|
|
17013
17801
|
path.skip();
|
|
17014
17802
|
}
|
|
17015
17803
|
});
|
|
@@ -60715,18 +61503,16 @@ class DereferenceVisitor {
|
|
|
60715
61503
|
toTranscludedElement(referencingElement, transclusion) {
|
|
60716
61504
|
// the referencing element waits for an enclosing element to transclude it
|
|
60717
61505
|
if (transclusion.keep) return referencingElement;
|
|
61506
|
+
let target = transclusion.target.element;
|
|
60718
61507
|
// an alias whose reference never reaches a value
|
|
60719
61508
|
if (transclusion.target.unresolved) {
|
|
60720
61509
|
const {
|
|
60721
61510
|
aliasField
|
|
60722
61511
|
} = transclusion;
|
|
60723
|
-
|
|
60724
|
-
|
|
60725
|
-
|
|
60726
|
-
|
|
60727
|
-
return transclusion.toTranscludedElement(referencingElement, fields);
|
|
60728
|
-
}
|
|
60729
|
-
if (transclusion.back && this.options.dereference.circular === 'replace') {
|
|
61512
|
+
if (aliasField === undefined || !(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(target)) return referencingElement;
|
|
61513
|
+
target = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneShallow)(target);
|
|
61514
|
+
target.remove(aliasField);
|
|
61515
|
+
} else if (transclusion.back && this.options.dereference.circular === 'replace') {
|
|
60730
61516
|
const refElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"](transclusion.circular.uri, {
|
|
60731
61517
|
type: referencingElement.element,
|
|
60732
61518
|
...transclusion.circular.meta
|
|
@@ -60734,7 +61520,21 @@ class DereferenceVisitor {
|
|
|
60734
61520
|
const replacer = this.options.dereference.strategyOpts[this.strategyName]?.circularReplacer ?? this.options.dereference.circularReplacer;
|
|
60735
61521
|
return replacer(refElement);
|
|
60736
61522
|
}
|
|
60737
|
-
|
|
61523
|
+
const transcludedElement = transclusion.toTranscludedElement(referencingElement, target);
|
|
61524
|
+
const {
|
|
61525
|
+
origin
|
|
61526
|
+
} = transclusion;
|
|
61527
|
+
// an element used as it is isn't annotated, and a transcluded target (a chain of references)
|
|
61528
|
+
// is defined where its own annotation says, which the element cloned from it carries
|
|
61529
|
+
if (origin === undefined || transcludedElement === target || transcludedElement === referencingElement || !target.isMetaEmpty && target.meta.hasKey('ref-type')) {
|
|
61530
|
+
return transcludedElement;
|
|
61531
|
+
}
|
|
61532
|
+
transcludedElement.meta.set('ref-origin', origin.uri);
|
|
61533
|
+
// an alias whose reference never reaches a value has no content to point at
|
|
61534
|
+
if (origin.jsonPointer !== undefined && !transclusion.target.unresolved) {
|
|
61535
|
+
transcludedElement.meta.set('ref-origin-pointer', origin.jsonPointer);
|
|
61536
|
+
}
|
|
61537
|
+
return transcludedElement;
|
|
60738
61538
|
}
|
|
60739
61539
|
|
|
60740
61540
|
/**
|
|
@@ -61543,8 +62343,7 @@ class Arazzo1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORTE
|
|
|
61543
62343
|
reference: runtimeExpression,
|
|
61544
62344
|
value: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(reusableElement.value)
|
|
61545
62345
|
});
|
|
61546
|
-
// annotate with info about
|
|
61547
|
-
mergedElement.meta.set('ref-origin', this.reference.uri);
|
|
62346
|
+
// annotate with info about type
|
|
61548
62347
|
mergedElement.meta.set('ref-type', element.element);
|
|
61549
62348
|
|
|
61550
62349
|
// override value field if present for Parameter Objects
|
|
@@ -61554,6 +62353,10 @@ class Arazzo1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORTE
|
|
|
61554
62353
|
}
|
|
61555
62354
|
return mergedElement;
|
|
61556
62355
|
},
|
|
62356
|
+
origin: {
|
|
62357
|
+
uri: _util_url_mjs__WEBPACK_IMPORTED_MODULE_21__.stripHash(this.reference.uri),
|
|
62358
|
+
jsonPointer
|
|
62359
|
+
},
|
|
61557
62360
|
circular: {
|
|
61558
62361
|
uri: runtimeExpression,
|
|
61559
62362
|
meta: {
|
|
@@ -61604,6 +62407,8 @@ class Arazzo1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORTE
|
|
|
61604
62407
|
let referencedElement;
|
|
61605
62408
|
// $ids of the schemas enclosing the referenced element within its document
|
|
61606
62409
|
let ancestorSchema$ids;
|
|
62410
|
+
// known when the reference is resolved by JSON Pointer against its document
|
|
62411
|
+
let jsonPointer;
|
|
61607
62412
|
try {
|
|
61608
62413
|
if (isUnknownURI || isURL) {
|
|
61609
62414
|
// we're dealing with canonical URI or URL with possible fragment
|
|
@@ -61709,12 +62514,12 @@ class Arazzo1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORTE
|
|
|
61709
62514
|
return;
|
|
61710
62515
|
}
|
|
61711
62516
|
reference = await this.toReference(_util_url_mjs__WEBPACK_IMPORTED_MODULE_21__.unsanitize($refBaseURI));
|
|
61712
|
-
|
|
62517
|
+
jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__.URIFragmentIdentifier.fromURIReference($refBaseURI);
|
|
61713
62518
|
const referenceAsSchema = this.toJSONSchemaDocument(reference.value.result);
|
|
61714
62519
|
({
|
|
61715
62520
|
element: referencedElement,
|
|
61716
62521
|
ancestorSchema$ids
|
|
61717
|
-
} = (0,_openapi_3_1_selectors_json_pointer_mjs__WEBPACK_IMPORTED_MODULE_17__.locate)(referenceAsSchema,
|
|
62522
|
+
} = (0,_openapi_3_1_selectors_json_pointer_mjs__WEBPACK_IMPORTED_MODULE_17__.locate)(referenceAsSchema, jsonPointer));
|
|
61718
62523
|
}
|
|
61719
62524
|
} else {
|
|
61720
62525
|
throw error;
|
|
@@ -61747,8 +62552,7 @@ class Arazzo1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORTE
|
|
|
61747
62552
|
booleanJsonSchemaElement.meta.set('ref-fields', {
|
|
61748
62553
|
$ref
|
|
61749
62554
|
});
|
|
61750
|
-
// annotate referenced element with info about
|
|
61751
|
-
booleanJsonSchemaElement.meta.set('ref-origin', origin);
|
|
62555
|
+
// annotate referenced element with info about type
|
|
61752
62556
|
booleanJsonSchemaElement.meta.set('ref-type', element.element);
|
|
61753
62557
|
return booleanJsonSchemaElement;
|
|
61754
62558
|
}
|
|
@@ -61768,12 +62572,15 @@ class Arazzo1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORTE
|
|
|
61768
62572
|
mergedElement.meta.set('ref-fields', {
|
|
61769
62573
|
$ref
|
|
61770
62574
|
});
|
|
61771
|
-
// annotate fragment with info about
|
|
61772
|
-
mergedElement.meta.set('ref-origin', origin);
|
|
62575
|
+
// annotate fragment with info about type
|
|
61773
62576
|
mergedElement.meta.set('ref-type', element.element);
|
|
61774
62577
|
return mergedElement;
|
|
61775
62578
|
},
|
|
61776
62579
|
aliasField: '$ref',
|
|
62580
|
+
origin: {
|
|
62581
|
+
uri: origin,
|
|
62582
|
+
jsonPointer
|
|
62583
|
+
},
|
|
61777
62584
|
circular: {
|
|
61778
62585
|
uri: $refBaseURI,
|
|
61779
62586
|
meta: {
|
|
@@ -62012,11 +62819,14 @@ class OpenAPI2DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORT
|
|
|
62012
62819
|
mergedElement.meta.set('ref-fields', {
|
|
62013
62820
|
$ref
|
|
62014
62821
|
});
|
|
62015
|
-
// annotate fragment with info about
|
|
62016
|
-
mergedElement.meta.set('ref-origin', reference.uri);
|
|
62822
|
+
// annotate fragment with info about type
|
|
62017
62823
|
mergedElement.meta.set('ref-type', element.element);
|
|
62018
62824
|
return mergedElement;
|
|
62019
62825
|
},
|
|
62826
|
+
origin: {
|
|
62827
|
+
uri: reference.uri,
|
|
62828
|
+
jsonPointer
|
|
62829
|
+
},
|
|
62020
62830
|
circular: {
|
|
62021
62831
|
uri: $refBaseURI,
|
|
62022
62832
|
meta: {
|
|
@@ -62095,12 +62905,15 @@ class OpenAPI2DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORT
|
|
|
62095
62905
|
mergedElement.meta.set('ref-fields', {
|
|
62096
62906
|
$ref
|
|
62097
62907
|
});
|
|
62098
|
-
// annotate referenced element with info about
|
|
62099
|
-
mergedElement.meta.set('ref-origin', reference.uri);
|
|
62908
|
+
// annotate referenced element with info about type
|
|
62100
62909
|
mergedElement.meta.set('ref-type', element.element);
|
|
62101
62910
|
return mergedElement;
|
|
62102
62911
|
},
|
|
62103
62912
|
aliasField: '$ref',
|
|
62913
|
+
origin: {
|
|
62914
|
+
uri: reference.uri,
|
|
62915
|
+
jsonPointer
|
|
62916
|
+
},
|
|
62104
62917
|
circular: {
|
|
62105
62918
|
uri: $refBaseURI,
|
|
62106
62919
|
meta: {
|
|
@@ -62173,11 +62986,14 @@ class OpenAPI2DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPORT
|
|
|
62173
62986
|
mergedElement.meta.set('ref-fields', {
|
|
62174
62987
|
$ref
|
|
62175
62988
|
});
|
|
62176
|
-
// annotate fragment with info about
|
|
62177
|
-
mergedElement.meta.set('ref-origin', reference.uri);
|
|
62989
|
+
// annotate fragment with info about type
|
|
62178
62990
|
mergedElement.meta.set('ref-type', element.element);
|
|
62179
62991
|
return mergedElement;
|
|
62180
62992
|
},
|
|
62993
|
+
origin: {
|
|
62994
|
+
uri: reference.uri,
|
|
62995
|
+
jsonPointer
|
|
62996
|
+
},
|
|
62181
62997
|
circular: {
|
|
62182
62998
|
uri: $refBaseURI,
|
|
62183
62999
|
meta: {
|
|
@@ -62411,11 +63227,14 @@ class OpenAPI3_0DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
62411
63227
|
mergedElement.meta.set('ref-fields', {
|
|
62412
63228
|
$ref
|
|
62413
63229
|
});
|
|
62414
|
-
// annotate fragment with info about
|
|
62415
|
-
mergedElement.meta.set('ref-origin', reference.uri);
|
|
63230
|
+
// annotate fragment with info about type
|
|
62416
63231
|
mergedElement.meta.set('ref-type', element.element);
|
|
62417
63232
|
return mergedElement;
|
|
62418
63233
|
},
|
|
63234
|
+
origin: {
|
|
63235
|
+
uri: reference.uri,
|
|
63236
|
+
jsonPointer
|
|
63237
|
+
},
|
|
62419
63238
|
circular: {
|
|
62420
63239
|
uri: $refBaseURI,
|
|
62421
63240
|
meta: {
|
|
@@ -62494,12 +63313,15 @@ class OpenAPI3_0DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
62494
63313
|
mergedElement.meta.set('ref-fields', {
|
|
62495
63314
|
$ref
|
|
62496
63315
|
});
|
|
62497
|
-
// annotate referenced element with info about
|
|
62498
|
-
mergedElement.meta.set('ref-origin', reference.uri);
|
|
63316
|
+
// annotate referenced element with info about type
|
|
62499
63317
|
mergedElement.meta.set('ref-type', element.element);
|
|
62500
63318
|
return mergedElement;
|
|
62501
63319
|
},
|
|
62502
63320
|
aliasField: '$ref',
|
|
63321
|
+
origin: {
|
|
63322
|
+
uri: reference.uri,
|
|
63323
|
+
jsonPointer
|
|
63324
|
+
},
|
|
62503
63325
|
circular: {
|
|
62504
63326
|
uri: $refBaseURI,
|
|
62505
63327
|
meta: {
|
|
@@ -62565,6 +63387,7 @@ class OpenAPI3_0DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
62565
63387
|
const operationCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(target);
|
|
62566
63388
|
// annotate operation element with info about origin and type
|
|
62567
63389
|
operationCopy.meta.set('ref-origin', reference.uri);
|
|
63390
|
+
operationCopy.meta.set('ref-origin-pointer', jsonPointer);
|
|
62568
63391
|
operationCopy.meta.set('ref-type', element.element);
|
|
62569
63392
|
|
|
62570
63393
|
/**
|
|
@@ -62595,8 +63418,14 @@ class OpenAPI3_0DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
62595
63418
|
/**
|
|
62596
63419
|
* Transclude Link Object containing Operation Object in its meta.
|
|
62597
63420
|
*/
|
|
63421
|
+
// create shallow clone to be able to annotate with metadata
|
|
63422
|
+
const operationCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(target);
|
|
63423
|
+
// annotate operation element with info about origin and type
|
|
63424
|
+
operationCopy.meta.set('ref-origin', reference.uri);
|
|
63425
|
+
operationCopy.meta.set('ref-origin-pointer', operationPath.formatPath());
|
|
63426
|
+
operationCopy.meta.set('ref-type', element.element);
|
|
62598
63427
|
const linkElementCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(element);
|
|
62599
|
-
linkElementCopy.operationId?.meta.set('operation',
|
|
63428
|
+
linkElementCopy.operationId?.meta.set('operation', operationCopy);
|
|
62600
63429
|
return linkElementCopy;
|
|
62601
63430
|
});
|
|
62602
63431
|
} catch (error) {
|
|
@@ -62652,6 +63481,7 @@ class OpenAPI3_0DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
62652
63481
|
const valueElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(target);
|
|
62653
63482
|
// annotate element with info about origin and type
|
|
62654
63483
|
valueElement.meta.set('ref-origin', reference.uri);
|
|
63484
|
+
valueElement.meta.set('ref-origin-pointer', '');
|
|
62655
63485
|
valueElement.meta.set('ref-type', element.element);
|
|
62656
63486
|
|
|
62657
63487
|
/**
|
|
@@ -63362,8 +64192,7 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63362
64192
|
description: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(reusingElement.get('description')),
|
|
63363
64193
|
summary: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(reusingElement.get('summary'))
|
|
63364
64194
|
});
|
|
63365
|
-
// annotate fragment with info about
|
|
63366
|
-
mergedElement.meta.set('ref-origin', reference.uri);
|
|
64195
|
+
// annotate fragment with info about type
|
|
63367
64196
|
mergedElement.meta.set('ref-type', element.element);
|
|
63368
64197
|
|
|
63369
64198
|
// override description and summary (outer has higher priority then inner)
|
|
@@ -63382,6 +64211,10 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63382
64211
|
}
|
|
63383
64212
|
return mergedElement;
|
|
63384
64213
|
},
|
|
64214
|
+
origin: {
|
|
64215
|
+
uri: reference.uri,
|
|
64216
|
+
jsonPointer
|
|
64217
|
+
},
|
|
63385
64218
|
circular: {
|
|
63386
64219
|
uri: $refBaseURI,
|
|
63387
64220
|
meta: {
|
|
@@ -63462,12 +64295,15 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63462
64295
|
mergedElement.meta.set('ref-fields', {
|
|
63463
64296
|
$ref
|
|
63464
64297
|
});
|
|
63465
|
-
// annotate referenced element with info about
|
|
63466
|
-
mergedElement.meta.set('ref-origin', reference.uri);
|
|
64298
|
+
// annotate referenced element with info about type
|
|
63467
64299
|
mergedElement.meta.set('ref-type', element.element);
|
|
63468
64300
|
return mergedElement;
|
|
63469
64301
|
},
|
|
63470
64302
|
aliasField: '$ref',
|
|
64303
|
+
origin: {
|
|
64304
|
+
uri: reference.uri,
|
|
64305
|
+
jsonPointer
|
|
64306
|
+
},
|
|
63471
64307
|
circular: {
|
|
63472
64308
|
uri: $refBaseURI,
|
|
63473
64309
|
meta: {
|
|
@@ -63535,6 +64371,7 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63535
64371
|
const operationCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneShallow)(target);
|
|
63536
64372
|
// annotate operation element with info about origin and type
|
|
63537
64373
|
operationCopy.meta.set('ref-origin', reference.uri);
|
|
64374
|
+
operationCopy.meta.set('ref-origin-pointer', jsonPointer);
|
|
63538
64375
|
operationCopy.meta.set('ref-type', element.element);
|
|
63539
64376
|
|
|
63540
64377
|
/**
|
|
@@ -63567,8 +64404,14 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63567
64404
|
/**
|
|
63568
64405
|
* Transclude Link Object containing Operation Object in its meta.
|
|
63569
64406
|
*/
|
|
64407
|
+
// create shallow clone to be able to annotate with metadata
|
|
64408
|
+
const operationCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneShallow)(target);
|
|
64409
|
+
// annotate operation element with info about origin and type
|
|
64410
|
+
operationCopy.meta.set('ref-origin', reference.uri);
|
|
64411
|
+
operationCopy.meta.set('ref-origin-pointer', operationPath.formatPath());
|
|
64412
|
+
operationCopy.meta.set('ref-type', element.element);
|
|
63570
64413
|
const linkElementCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneShallow)(element);
|
|
63571
|
-
linkElementCopy.operationId?.meta.set('operation',
|
|
64414
|
+
linkElementCopy.operationId?.meta.set('operation', operationCopy);
|
|
63572
64415
|
return linkElementCopy;
|
|
63573
64416
|
});
|
|
63574
64417
|
} catch (error) {
|
|
@@ -63626,6 +64469,7 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63626
64469
|
const valueElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneShallow)(target);
|
|
63627
64470
|
// annotate element with info about origin and type
|
|
63628
64471
|
valueElement.meta.set('ref-origin', reference.uri);
|
|
64472
|
+
valueElement.meta.set('ref-origin-pointer', '');
|
|
63629
64473
|
valueElement.meta.set('ref-type', element.element);
|
|
63630
64474
|
|
|
63631
64475
|
/**
|
|
@@ -63674,6 +64518,8 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63674
64518
|
let referencedElement;
|
|
63675
64519
|
// $ids of the schemas enclosing the referenced element within its document
|
|
63676
64520
|
let ancestorSchema$ids;
|
|
64521
|
+
// known when the reference is resolved by JSON Pointer against its document
|
|
64522
|
+
let jsonPointer;
|
|
63677
64523
|
try {
|
|
63678
64524
|
if (isUnknownURI || isURL) {
|
|
63679
64525
|
// we're dealing with canonical URI or URL with possible fragment
|
|
@@ -63796,11 +64642,11 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63796
64642
|
return;
|
|
63797
64643
|
}
|
|
63798
64644
|
reference = await this.toReference(_util_url_mjs__WEBPACK_IMPORTED_MODULE_20__.unsanitize($refBaseURI));
|
|
63799
|
-
|
|
64645
|
+
jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.URIFragmentIdentifier.fromURIReference($refBaseURI);
|
|
63800
64646
|
({
|
|
63801
64647
|
element: referencedElement,
|
|
63802
64648
|
ancestorSchema$ids
|
|
63803
|
-
} = (0,_selectors_json_pointer_mjs__WEBPACK_IMPORTED_MODULE_17__.locate)(this.toSchemaDocument(reference.value.result),
|
|
64649
|
+
} = (0,_selectors_json_pointer_mjs__WEBPACK_IMPORTED_MODULE_17__.locate)(this.toSchemaDocument(reference.value.result), jsonPointer));
|
|
63804
64650
|
}
|
|
63805
64651
|
} else {
|
|
63806
64652
|
throw error;
|
|
@@ -63832,8 +64678,7 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63832
64678
|
booleanJsonSchemaElement.meta.set('ref-fields', {
|
|
63833
64679
|
$ref
|
|
63834
64680
|
});
|
|
63835
|
-
// annotate referenced element with info about
|
|
63836
|
-
booleanJsonSchemaElement.meta.set('ref-origin', origin);
|
|
64681
|
+
// annotate referenced element with info about type
|
|
63837
64682
|
booleanJsonSchemaElement.meta.set('ref-type', element.element);
|
|
63838
64683
|
return booleanJsonSchemaElement;
|
|
63839
64684
|
}
|
|
@@ -63853,12 +64698,15 @@ class OpenAPI3_1DereferenceVisitor extends _DereferenceVisitor_mjs__WEBPACK_IMPO
|
|
|
63853
64698
|
mergedElement.meta.set('ref-fields', {
|
|
63854
64699
|
$ref
|
|
63855
64700
|
});
|
|
63856
|
-
// annotate fragment with info about
|
|
63857
|
-
mergedElement.meta.set('ref-origin', origin);
|
|
64701
|
+
// annotate fragment with info about type
|
|
63858
64702
|
mergedElement.meta.set('ref-type', element.element);
|
|
63859
64703
|
return mergedElement;
|
|
63860
64704
|
},
|
|
63861
64705
|
aliasField: '$ref',
|
|
64706
|
+
origin: {
|
|
64707
|
+
uri: origin,
|
|
64708
|
+
jsonPointer
|
|
64709
|
+
},
|
|
63862
64710
|
circular: {
|
|
63863
64711
|
uri: $refBaseURI,
|
|
63864
64712
|
meta: {
|
|
@@ -91616,18 +92464,34 @@ function throwIfCancellationRequested(config) {
|
|
|
91616
92464
|
}
|
|
91617
92465
|
|
|
91618
92466
|
/**
|
|
91619
|
-
*
|
|
92467
|
+
* Resolve the clock used to time adapter execution.
|
|
91620
92468
|
*
|
|
91621
|
-
*
|
|
91622
|
-
*
|
|
91623
|
-
*
|
|
92469
|
+
* Prefers the monotonic `performance.now()` so wall-clock adjustments do not
|
|
92470
|
+
* skew the measurement, and so frameworks that forbid reading the current
|
|
92471
|
+
* time during prerendering (e.g. Next.js Cache Components) accept it. Falls
|
|
92472
|
+
* back to `Date.now()` in runtimes without the High Resolution Time API.
|
|
91624
92473
|
*
|
|
91625
|
-
* @
|
|
92474
|
+
* @returns {() => number} Millisecond clock
|
|
92475
|
+
*/
|
|
92476
|
+
function resolveClock() {
|
|
92477
|
+
return typeof performance !== 'undefined' && _utils_js__WEBPACK_IMPORTED_MODULE_6__["default"].isFunction(performance.now)
|
|
92478
|
+
? () => performance.now()
|
|
92479
|
+
: Date.now;
|
|
92480
|
+
}
|
|
92481
|
+
|
|
92482
|
+
/**
|
|
92483
|
+
* Whole milliseconds elapsed since `start`, floored at zero.
|
|
92484
|
+
*
|
|
92485
|
+
* Rounded so the value stays an integer as with `Date.now()`. The fallback
|
|
92486
|
+
* wall clock can move backwards mid-request, so the result is clamped.
|
|
92487
|
+
*
|
|
92488
|
+
* @param {() => number} now Clock returned by `resolveClock()`
|
|
92489
|
+
* @param {number} start Timestamp read from `now`
|
|
91626
92490
|
*
|
|
91627
92491
|
* @returns {number} Non-negative elapsed milliseconds
|
|
91628
92492
|
*/
|
|
91629
|
-
function elapsedSince(start) {
|
|
91630
|
-
return Math.max(0,
|
|
92493
|
+
function elapsedSince(now, start) {
|
|
92494
|
+
return Math.max(0, Math.round(now() - start));
|
|
91631
92495
|
}
|
|
91632
92496
|
|
|
91633
92497
|
/**
|
|
@@ -91656,13 +92520,14 @@ function dispatchRequest(_config) {
|
|
|
91656
92520
|
|
|
91657
92521
|
const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_5__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].adapter, config);
|
|
91658
92522
|
|
|
91659
|
-
const
|
|
92523
|
+
const now = resolveClock();
|
|
92524
|
+
const start = now();
|
|
91660
92525
|
|
|
91661
92526
|
return adapter(config).then(
|
|
91662
92527
|
function onAdapterResolution(response) {
|
|
91663
92528
|
throwIfCancellationRequested(config);
|
|
91664
92529
|
|
|
91665
|
-
response.duration = elapsedSince(start);
|
|
92530
|
+
response.duration = elapsedSince(now, start);
|
|
91666
92531
|
|
|
91667
92532
|
// Expose the current response on config so that transformResponse can
|
|
91668
92533
|
// attach it to any AxiosError it throws (e.g. on JSON parse failure).
|
|
@@ -91684,7 +92549,7 @@ function dispatchRequest(_config) {
|
|
|
91684
92549
|
|
|
91685
92550
|
// Transform response data
|
|
91686
92551
|
if (reason && reason.response) {
|
|
91687
|
-
reason.response.duration = elapsedSince(start);
|
|
92552
|
+
reason.response.duration = elapsedSince(now, start);
|
|
91688
92553
|
config.response = reason.response;
|
|
91689
92554
|
try {
|
|
91690
92555
|
reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(
|
|
@@ -92339,7 +93204,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
92339
93204
|
|
|
92340
93205
|
"use strict";
|
|
92341
93206
|
__webpack_require__.r(__webpack_exports__);
|
|
92342
|
-
const VERSION = "1.21.
|
|
93207
|
+
const VERSION = "1.21.1";
|
|
92343
93208
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
92344
93209
|
/* harmony export */ "VERSION", 0, /* binding */ VERSION
|
|
92345
93210
|
/* harmony export */ ]);
|
|
@@ -118972,6 +119837,16 @@ var r={8341(e,t,n){n(7603);var r=n(2856);e.exports=r("Array","includes")},5161(e
|
|
|
118972
119837
|
/******/ }
|
|
118973
119838
|
/******/
|
|
118974
119839
|
/************************************************************************/
|
|
119840
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
119841
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
119842
|
+
/******/ __webpack_require__.n = (module) => {
|
|
119843
|
+
/******/ const getter = module && module.__esModule ?
|
|
119844
|
+
/******/ () => (module['default']) :
|
|
119845
|
+
/******/ () => (module);
|
|
119846
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
119847
|
+
/******/ return getter;
|
|
119848
|
+
/******/ };
|
|
119849
|
+
/******/
|
|
118975
119850
|
/******/ /* webpack/runtime/create fake namespace object */
|
|
118976
119851
|
/******/ (() => {
|
|
118977
119852
|
/******/ const getProto = Object.getPrototypeOf;
|
|
@@ -119075,7 +119950,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
119075
119950
|
/* harmony export */ ArazzoDocument: () => (/* reexport safe */ _document_ArazzoDocument_ts__WEBPACK_IMPORTED_MODULE_6__["default"]),
|
|
119076
119951
|
/* harmony export */ ArazzoDocumentRegistryProvider: () => (/* reexport safe */ _registry_providers_ArazzoDocumentRegistryProvider_ts__WEBPACK_IMPORTED_MODULE_3__["default"]),
|
|
119077
119952
|
/* harmony export */ ArazzoRunner: () => (/* reexport safe */ _ArazzoRunner_ts__WEBPACK_IMPORTED_MODULE_0__["default"]),
|
|
119078
|
-
/* harmony export */ ArazzoRunnerError: () => (/* reexport safe */
|
|
119953
|
+
/* harmony export */ ArazzoRunnerError: () => (/* reexport safe */ _errors_ArazzoRunnerError_ts__WEBPACK_IMPORTED_MODULE_49__["default"]),
|
|
119079
119954
|
/* harmony export */ ArazzoSourceDescriptionIndex: () => (/* reexport safe */ _document_ArazzoSourceDescriptionIndex_ts__WEBPACK_IMPORTED_MODULE_10__["default"]),
|
|
119080
119955
|
/* harmony export */ ArazzoStepExtractor: () => (/* reexport safe */ _extractor_ArazzoStepExtractor_ts__WEBPACK_IMPORTED_MODULE_13__["default"]),
|
|
119081
119956
|
/* harmony export */ ArazzoStepIndex: () => (/* reexport safe */ _document_ArazzoStepIndex_ts__WEBPACK_IMPORTED_MODULE_9__["default"]),
|
|
@@ -119085,19 +119960,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
119085
119960
|
/* harmony export */ ArazzoWorkflowIndex: () => (/* reexport safe */ _document_ArazzoWorkflowIndex_ts__WEBPACK_IMPORTED_MODULE_8__["default"]),
|
|
119086
119961
|
/* harmony export */ ArazzoWorkflowLocatorNormalizer: () => (/* reexport safe */ _executor_ArazzoWorkflowLocatorNormalizer_ts__WEBPACK_IMPORTED_MODULE_47__["default"]),
|
|
119087
119962
|
/* harmony export */ ArazzoWorkflowNormalizer: () => (/* reexport safe */ _normalizer_ArazzoWorkflowNormalizer_ts__WEBPACK_IMPORTED_MODULE_15__["default"]),
|
|
119088
|
-
/* harmony export */ AssemblerError: () => (/* reexport safe */
|
|
119089
|
-
/* harmony export */ ClientError: () => (/* reexport safe */
|
|
119090
|
-
/* harmony export */ CriterionError: () => (/* reexport safe */
|
|
119091
|
-
/* harmony export */ CriterionEvaluationError: () => (/* reexport safe */
|
|
119963
|
+
/* harmony export */ AssemblerError: () => (/* reexport safe */ _errors_AssemblerError_ts__WEBPACK_IMPORTED_MODULE_50__["default"]),
|
|
119964
|
+
/* harmony export */ ClientError: () => (/* reexport safe */ _errors_ClientError_ts__WEBPACK_IMPORTED_MODULE_51__["default"]),
|
|
119965
|
+
/* harmony export */ CriterionError: () => (/* reexport safe */ _errors_CriterionError_ts__WEBPACK_IMPORTED_MODULE_58__["default"]),
|
|
119966
|
+
/* harmony export */ CriterionEvaluationError: () => (/* reexport safe */ _errors_CriterionEvaluationError_ts__WEBPACK_IMPORTED_MODULE_59__["default"]),
|
|
119092
119967
|
/* harmony export */ CriterionEvaluator: () => (/* reexport safe */ _criterion_CriterionEvaluator_ts__WEBPACK_IMPORTED_MODULE_29__["default"]),
|
|
119093
|
-
/* harmony export */ DocumentLoadError: () => (/* reexport safe */
|
|
119968
|
+
/* harmony export */ DocumentLoadError: () => (/* reexport safe */ _errors_DocumentLoadError_ts__WEBPACK_IMPORTED_MODULE_56__["default"]),
|
|
119094
119969
|
/* harmony export */ DocumentRegistry: () => (/* reexport safe */ _registry_DocumentRegistry_ts__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
119095
119970
|
/* harmony export */ DocumentRegistryProvider: () => (/* reexport safe */ _registry_providers_DocumentRegistryProvider_ts__WEBPACK_IMPORTED_MODULE_2__["default"]),
|
|
119096
|
-
/* harmony export */ ExecutionError: () => (/* reexport safe */
|
|
119097
|
-
/* harmony export */ ExtractionError: () => (/* reexport safe */
|
|
119098
|
-
/* harmony export */ InvalidEntryDocumentError: () => (/* reexport safe */
|
|
119971
|
+
/* harmony export */ ExecutionError: () => (/* reexport safe */ _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_61__["default"]),
|
|
119972
|
+
/* harmony export */ ExtractionError: () => (/* reexport safe */ _errors_ExtractionError_ts__WEBPACK_IMPORTED_MODULE_53__["default"]),
|
|
119973
|
+
/* harmony export */ InvalidEntryDocumentError: () => (/* reexport safe */ _errors_InvalidEntryDocumentError_ts__WEBPACK_IMPORTED_MODULE_54__["default"]),
|
|
119099
119974
|
/* harmony export */ JSONPathCriterionEvaluator: () => (/* reexport safe */ _criterion_JSONPathCriterionEvaluator_ts__WEBPACK_IMPORTED_MODULE_32__["default"]),
|
|
119100
|
-
/* harmony export */ NormalizationError: () => (/* reexport safe */
|
|
119975
|
+
/* harmony export */ NormalizationError: () => (/* reexport safe */ _errors_NormalizationError_ts__WEBPACK_IMPORTED_MODULE_52__["default"]),
|
|
119101
119976
|
/* harmony export */ OpenAPI2DocumentAssembler: () => (/* reexport safe */ _assembler_OpenAPI2DocumentAssembler_ts__WEBPACK_IMPORTED_MODULE_22__["default"]),
|
|
119102
119977
|
/* harmony export */ OpenAPI2OperationNormalizer: () => (/* reexport safe */ _normalizer_OpenAPI2OperationNormalizer_ts__WEBPACK_IMPORTED_MODULE_18__["default"]),
|
|
119103
119978
|
/* harmony export */ OpenAPI30DocumentAssembler: () => (/* reexport safe */ _assembler_OpenAPI30DocumentAssembler_ts__WEBPACK_IMPORTED_MODULE_23__["default"]),
|
|
@@ -119116,16 +119991,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
119116
119991
|
/* harmony export */ OpenAPIOperationResponse: () => (/* reexport safe */ _client_OpenAPIOperationResponse_ts__WEBPACK_IMPORTED_MODULE_26__["default"]),
|
|
119117
119992
|
/* harmony export */ OpenAPIOperationResponseNormalizer: () => (/* reexport safe */ _client_OpenAPIOperationResponseNormalizer_ts__WEBPACK_IMPORTED_MODULE_27__["default"]),
|
|
119118
119993
|
/* harmony export */ OutputResolver: () => (/* reexport safe */ _resolver_OutputResolver_ts__WEBPACK_IMPORTED_MODULE_39__["default"]),
|
|
119994
|
+
/* harmony export */ Redactor: () => (/* reexport safe */ _observability_Redactor_ts__WEBPACK_IMPORTED_MODULE_48__["default"]),
|
|
119119
119995
|
/* harmony export */ RegexCriterionEvaluator: () => (/* reexport safe */ _criterion_RegexCriterionEvaluator_ts__WEBPACK_IMPORTED_MODULE_31__["default"]),
|
|
119120
119996
|
/* harmony export */ RequestBodyResolver: () => (/* reexport safe */ _resolver_RequestBodyResolver_ts__WEBPACK_IMPORTED_MODULE_40__["default"]),
|
|
119121
|
-
/* harmony export */ ResolverError: () => (/* reexport safe */
|
|
119122
|
-
/* harmony export */ RuntimeExpressionError: () => (/* reexport safe */
|
|
119997
|
+
/* harmony export */ ResolverError: () => (/* reexport safe */ _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_60__["default"]),
|
|
119998
|
+
/* harmony export */ RuntimeExpressionError: () => (/* reexport safe */ _errors_RuntimeExpressionError_ts__WEBPACK_IMPORTED_MODULE_57__["default"]),
|
|
119123
119999
|
/* harmony export */ RuntimeExpressionEvaluator: () => (/* reexport safe */ _expression_RuntimeExpressionEvaluator_ts__WEBPACK_IMPORTED_MODULE_28__["default"]),
|
|
119124
120000
|
/* harmony export */ SimpleCriterionEvaluator: () => (/* reexport safe */ _criterion_SimpleCriterionEvaluator_ts__WEBPACK_IMPORTED_MODULE_30__["default"]),
|
|
119125
120001
|
/* harmony export */ SourceDescriptionsLocatorNormalizer: () => (/* reexport safe */ _executor_SourceDescriptionsLocatorNormalizer_ts__WEBPACK_IMPORTED_MODULE_45__["default"]),
|
|
119126
120002
|
/* harmony export */ StepExecutor: () => (/* reexport safe */ _executor_StepExecutor_ts__WEBPACK_IMPORTED_MODULE_43__["default"]),
|
|
119127
120003
|
/* harmony export */ StepParameterResolver: () => (/* reexport safe */ _resolver_StepParameterResolver_ts__WEBPACK_IMPORTED_MODULE_36__["default"]),
|
|
119128
|
-
/* harmony export */ UnmatchedProviderError: () => (/* reexport safe */
|
|
120004
|
+
/* harmony export */ UnmatchedProviderError: () => (/* reexport safe */ _errors_UnmatchedProviderError_ts__WEBPACK_IMPORTED_MODULE_55__["default"]),
|
|
119129
120005
|
/* harmony export */ WorkflowExecutionState: () => (/* reexport safe */ _state_WorkflowExecutionState_ts__WEBPACK_IMPORTED_MODULE_34__["default"]),
|
|
119130
120006
|
/* harmony export */ WorkflowExecutor: () => (/* reexport safe */ _executor_WorkflowExecutor_ts__WEBPACK_IMPORTED_MODULE_42__["default"]),
|
|
119131
120007
|
/* harmony export */ WorkflowParameterResolver: () => (/* reexport safe */ _resolver_WorkflowParameterResolver_ts__WEBPACK_IMPORTED_MODULE_38__["default"]),
|
|
@@ -119181,19 +120057,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
119181
120057
|
/* harmony import */ var _executor_SourceDescriptionsLocatorNormalizer_ts__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(83461);
|
|
119182
120058
|
/* harmony import */ var _executor_OpenAPIOperationLocatorNormalizer_ts__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(7308);
|
|
119183
120059
|
/* harmony import */ var _executor_ArazzoWorkflowLocatorNormalizer_ts__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(98885);
|
|
119184
|
-
/* harmony import */ var
|
|
119185
|
-
/* harmony import */ var
|
|
119186
|
-
/* harmony import */ var
|
|
119187
|
-
/* harmony import */ var
|
|
119188
|
-
/* harmony import */ var
|
|
119189
|
-
/* harmony import */ var
|
|
119190
|
-
/* harmony import */ var
|
|
119191
|
-
/* harmony import */ var
|
|
119192
|
-
/* harmony import */ var
|
|
119193
|
-
/* harmony import */ var
|
|
119194
|
-
/* harmony import */ var
|
|
119195
|
-
/* harmony import */ var
|
|
119196
|
-
/* harmony import */ var
|
|
120060
|
+
/* harmony import */ var _observability_Redactor_ts__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(4050);
|
|
120061
|
+
/* harmony import */ var _errors_ArazzoRunnerError_ts__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(23949);
|
|
120062
|
+
/* harmony import */ var _errors_AssemblerError_ts__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(90706);
|
|
120063
|
+
/* harmony import */ var _errors_ClientError_ts__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(81763);
|
|
120064
|
+
/* harmony import */ var _errors_NormalizationError_ts__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(35523);
|
|
120065
|
+
/* harmony import */ var _errors_ExtractionError_ts__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(90713);
|
|
120066
|
+
/* harmony import */ var _errors_InvalidEntryDocumentError_ts__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(40198);
|
|
120067
|
+
/* harmony import */ var _errors_UnmatchedProviderError_ts__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(46132);
|
|
120068
|
+
/* harmony import */ var _errors_DocumentLoadError_ts__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(24089);
|
|
120069
|
+
/* harmony import */ var _errors_RuntimeExpressionError_ts__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(48770);
|
|
120070
|
+
/* harmony import */ var _errors_CriterionError_ts__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(41233);
|
|
120071
|
+
/* harmony import */ var _errors_CriterionEvaluationError_ts__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(71731);
|
|
120072
|
+
/* harmony import */ var _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(8696);
|
|
120073
|
+
/* harmony import */ var _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(17658);
|
|
119197
120074
|
/* Runner */
|
|
119198
120075
|
|
|
119199
120076
|
|
|
@@ -119265,6 +120142,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
119265
120142
|
|
|
119266
120143
|
|
|
119267
120144
|
|
|
120145
|
+
|
|
120146
|
+
/* Observability */
|
|
120147
|
+
|
|
120148
|
+
|
|
119268
120149
|
/* Errors */
|
|
119269
120150
|
|
|
119270
120151
|
|