@api-client/core 0.6.31 → 0.7.2
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/build/browser.d.ts +6 -14
- package/build/browser.js +11 -16
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +8 -20
- package/build/index.js +13 -25
- package/build/index.js.map +1 -1
- package/build/src/amf/ApiSchemaValues.d.ts +2 -0
- package/build/src/amf/ApiSchemaValues.js +29 -23
- package/build/src/amf/ApiSchemaValues.js.map +1 -1
- package/build/src/authorization/lib/Utils.d.ts +1 -1
- package/build/src/cookies/CookieJar.d.ts +23 -0
- package/build/src/cookies/CookieJar.js +3 -0
- package/build/src/cookies/CookieJar.js.map +1 -0
- package/build/src/cookies/CookieParser.d.ts +67 -0
- package/build/src/cookies/CookieParser.js +316 -0
- package/build/src/cookies/CookieParser.js.map +1 -0
- package/build/src/cookies/InMemoryCookieJar.d.ts +12 -0
- package/build/src/cookies/InMemoryCookieJar.js +68 -0
- package/build/src/cookies/InMemoryCookieJar.js.map +1 -0
- package/build/src/cookies/Punycode.d.ts +12 -0
- package/build/src/cookies/Punycode.js +124 -0
- package/build/src/cookies/Punycode.js.map +1 -0
- package/build/src/data/RequestDataExtractor.d.ts +8 -7
- package/build/src/data/RequestDataExtractor.js +8 -10
- package/build/src/data/RequestDataExtractor.js.map +1 -1
- package/build/src/events/CustomEvent.js +5 -0
- package/build/src/events/CustomEvent.js.map +1 -1
- package/build/src/events/EventTypes.d.ts +43 -43
- package/build/src/events/amf/AmfEventTypes.d.ts +4 -4
- package/build/src/events/authorization/AuthorizationEventTypes.d.ts +4 -4
- package/build/src/events/cookies/CookieEventTypes.d.ts +9 -9
- package/build/src/events/encryption/EncryptionEventTypes.d.ts +2 -2
- package/build/src/events/environment/EnvironmentEventTypes.d.ts +1 -1
- package/build/src/events/models/ModelEventTypes.d.ts +7 -7
- package/build/src/events/process/ProcessEventTypes.d.ts +3 -3
- package/build/src/events/reporting/ReportingEventTypes.d.ts +1 -1
- package/build/src/events/telemetry/TelemetryEventTypes.d.ts +6 -6
- package/build/src/events/transport/TransportEventTypes.d.ts +6 -6
- package/build/src/events/transport/TransportEvents.d.ts +2 -2
- package/build/src/mocking/ProjectMock.d.ts +3 -2
- package/build/src/mocking/ProjectMock.js +3 -3
- package/build/src/mocking/ProjectMock.js.map +1 -1
- package/build/src/mocking/lib/App.d.ts +36 -0
- package/build/src/mocking/lib/App.js +70 -0
- package/build/src/mocking/lib/App.js.map +1 -0
- package/build/src/models/{arc/ArcProject.d.ts → AppProject.d.ts} +296 -134
- package/build/src/models/{arc/ArcProject.js → AppProject.js} +436 -79
- package/build/src/models/AppProject.js.map +1 -0
- package/build/src/models/AppRequest.d.ts +69 -0
- package/build/src/models/{arc/ArcHttpRequest.js → AppRequest.js} +53 -17
- package/build/src/models/AppRequest.js.map +1 -0
- package/build/src/models/ClientCertificate.d.ts +2 -2
- package/build/src/models/Environment.d.ts +8 -1
- package/build/src/models/Environment.js +21 -0
- package/build/src/models/Environment.js.map +1 -1
- package/build/src/models/HostRule.d.ts +2 -2
- package/build/src/models/HttpCookie.d.ts +63 -12
- package/build/src/models/HttpCookie.js +178 -44
- package/build/src/models/HttpCookie.js.map +1 -1
- package/build/src/models/HttpHistory.d.ts +8 -3
- package/build/src/models/HttpHistory.js +3 -3
- package/build/src/models/HttpHistory.js.map +1 -1
- package/build/src/models/HttpProject.d.ts +34 -1
- package/build/src/models/HttpProject.js +104 -8
- package/build/src/models/HttpProject.js.map +1 -1
- package/build/src/models/ProjectFolder.d.ts +2 -0
- package/build/src/models/ProjectFolder.js +14 -0
- package/build/src/models/ProjectFolder.js.map +1 -1
- package/build/src/models/ProjectItem.d.ts +2 -0
- package/build/src/models/ProjectItem.js +20 -0
- package/build/src/models/ProjectItem.js.map +1 -1
- package/build/src/models/ProjectParent.js.map +1 -1
- package/build/src/models/ProjectRequest.d.ts +3 -2
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/Property.d.ts +2 -2
- package/build/src/models/Property.js +2 -2
- package/build/src/models/Property.js.map +1 -1
- package/build/src/models/Request.d.ts +16 -8
- package/build/src/models/Request.js +20 -15
- package/build/src/models/Request.js.map +1 -1
- package/build/src/models/RequestAuthorization.js.map +1 -1
- package/build/src/models/RequestUiMeta.d.ts +0 -14
- package/build/src/models/RequestUiMeta.js +1 -10
- package/build/src/models/RequestUiMeta.js.map +1 -1
- package/build/src/models/Server.d.ts +1 -2
- package/build/src/models/Server.js.map +1 -1
- package/build/src/models/http-actions/HttpActions.d.ts +256 -0
- package/build/src/models/http-actions/HttpActions.js +46 -0
- package/build/src/models/http-actions/HttpActions.js.map +1 -0
- package/build/src/models/http-actions/LegacyTranslator.d.ts +17 -0
- package/build/src/models/http-actions/LegacyTranslator.js +222 -0
- package/build/src/models/http-actions/LegacyTranslator.js.map +1 -0
- package/build/src/models/store/Backend.d.ts +136 -1
- package/build/src/models/store/File.d.ts +1 -1
- package/build/src/models/store/File.js +2 -0
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/models/store/User.d.ts +3 -3
- package/build/src/runtime/http-engine/CoreEngine.d.ts +2 -0
- package/build/src/runtime/http-engine/CoreEngine.js +1 -0
- package/build/src/runtime/http-engine/CoreEngine.js.map +1 -1
- package/build/src/runtime/http-engine/HttpEngine.d.ts +13 -0
- package/build/src/runtime/http-engine/HttpEngine.js +39 -31
- package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
- package/build/src/runtime/{actions/ConditionRunner.d.ts → http-runner/ConditionCheck.d.ts} +2 -2
- package/build/src/runtime/{actions/ConditionRunner.js → http-runner/ConditionCheck.js} +2 -2
- package/build/src/runtime/http-runner/ConditionCheck.js.map +1 -0
- package/build/src/runtime/http-runner/HttpFlowRunner.d.ts +62 -0
- package/build/src/runtime/http-runner/HttpFlowRunner.js +217 -0
- package/build/src/runtime/http-runner/HttpFlowRunner.js.map +1 -0
- package/build/src/runtime/{node/RequestFactory.d.ts → http-runner/HttpRequestRunner.d.ts} +40 -54
- package/build/src/runtime/http-runner/HttpRequestRunner.js +316 -0
- package/build/src/runtime/http-runner/HttpRequestRunner.js.map +1 -0
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.d.ts +25 -0
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js +2 -0
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js.map +1 -0
- package/build/src/runtime/http-runner/RequestAuthorizationProcessor.d.ts +56 -0
- package/build/src/runtime/http-runner/RequestAuthorizationProcessor.js +143 -0
- package/build/src/runtime/http-runner/RequestAuthorizationProcessor.js.map +1 -0
- package/build/src/runtime/http-runner/RequestCookiesProcessor.d.ts +24 -0
- package/build/src/runtime/http-runner/RequestCookiesProcessor.js +65 -0
- package/build/src/runtime/http-runner/RequestCookiesProcessor.js.map +1 -0
- package/build/src/runtime/node/InteropInterfaces.d.ts +21 -6
- package/build/src/runtime/node/ProjectParallelRunner.js +3 -1
- package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRequestRunner.d.ts +24 -10
- package/build/src/runtime/node/ProjectRequestRunner.js +116 -45
- package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunner.d.ts +5 -7
- package/build/src/runtime/node/ProjectRunner.js +30 -14
- package/build/src/runtime/node/ProjectRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunnerWorker.js +3 -0
- package/build/src/runtime/node/ProjectRunnerWorker.js.map +1 -1
- package/build/src/runtime/reporters/Reporter.d.ts +5 -0
- package/build/src/runtime/reporters/Reporter.js.map +1 -1
- package/build/src/runtime/store/AppSdk.d.ts +185 -0
- package/build/src/runtime/store/AppSdk.js +704 -0
- package/build/src/runtime/store/AppSdk.js.map +1 -0
- package/build/src/runtime/store/FilesSdk.js +4 -4
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/build/src/runtime/store/HistorySdk.js +2 -2
- package/build/src/runtime/store/HistorySdk.js.map +1 -1
- package/build/src/runtime/store/RouteBuilder.d.ts +17 -2
- package/build/src/runtime/store/RouteBuilder.js +60 -3
- package/build/src/runtime/store/RouteBuilder.js.map +1 -1
- package/build/src/runtime/store/Sdk.d.ts +5 -0
- package/build/src/runtime/store/Sdk.js +5 -0
- package/build/src/runtime/store/Sdk.js.map +1 -1
- package/build/src/runtime/store/SharedSdk.js +1 -1
- package/build/src/runtime/store/SharedSdk.js.map +1 -1
- package/build/src/runtime/store/UsersSdk.js +1 -1
- package/build/src/runtime/store/UsersSdk.js.map +1 -1
- package/package.json +2 -2
- package/src/amf/ApiSchemaValues.ts +41 -33
- package/src/cookies/CookieJar.ts +26 -0
- package/src/cookies/CookieParser.ts +327 -0
- package/src/cookies/InMemoryCookieJar.ts +70 -0
- package/src/cookies/Punycode.ts +133 -0
- package/src/data/RequestDataExtractor.ts +14 -15
- package/src/events/CustomEvent.ts +4 -0
- package/src/mocking/ProjectMock.ts +4 -3
- package/src/mocking/lib/App.ts +101 -0
- package/src/models/{arc/ArcProject.ts → AppProject.ts} +671 -225
- package/src/models/AppRequest.ts +176 -0
- package/src/models/ClientCertificate.ts +2 -2
- package/src/models/Environment.ts +24 -2
- package/src/models/HostRule.ts +2 -2
- package/src/models/HttpCookie.ts +210 -48
- package/src/models/HttpHistory.ts +12 -5
- package/src/models/HttpProject.ts +113 -10
- package/src/models/ProjectFolder.ts +16 -0
- package/src/models/ProjectItem.ts +18 -0
- package/src/models/ProjectParent.ts +4 -1
- package/src/models/ProjectRequest.ts +4 -3
- package/src/models/Property.ts +4 -4
- package/src/models/Request.ts +29 -19
- package/src/models/RequestAuthorization.ts +4 -4
- package/src/models/RequestUiMeta.ts +1 -21
- package/src/models/Server.ts +1 -2
- package/src/models/http-actions/HttpActions.ts +270 -0
- package/src/models/http-actions/LegacyTranslator.ts +223 -0
- package/src/models/store/Backend.ts +148 -2
- package/src/models/store/File.ts +3 -1
- package/src/models/store/User.ts +3 -3
- package/src/runtime/http-engine/CoreEngine.ts +3 -2
- package/src/runtime/http-engine/HttpEngine.ts +48 -30
- package/src/runtime/{actions/ConditionRunner.ts → http-runner/ConditionCheck.ts} +3 -3
- package/src/runtime/http-runner/HttpFlowRunner.ts +232 -0
- package/src/runtime/http-runner/HttpRequestRunner.ts +353 -0
- package/src/runtime/http-runner/HttpRuntimeEnvironment.ts +27 -0
- package/src/runtime/http-runner/RequestAuthorizationProcessor.ts +144 -0
- package/src/runtime/http-runner/RequestCookiesProcessor.ts +74 -0
- package/src/runtime/node/InteropInterfaces.ts +24 -6
- package/src/runtime/node/ProjectParallelRunner.ts +4 -2
- package/src/runtime/node/ProjectRequestRunner.ts +130 -60
- package/src/runtime/node/ProjectRunner.ts +37 -22
- package/src/runtime/node/ProjectRunnerWorker.ts +3 -0
- package/src/runtime/reporters/Reporter.ts +5 -0
- package/src/runtime/store/AppSdk.ts +709 -0
- package/src/runtime/store/FilesSdk.ts +4 -4
- package/src/runtime/store/HistorySdk.ts +2 -2
- package/src/runtime/store/RouteBuilder.ts +75 -3
- package/src/runtime/store/Sdk.ts +6 -0
- package/src/runtime/store/SharedSdk.ts +1 -1
- package/src/runtime/store/UsersSdk.ts +1 -1
- package/build/src/lib/cookies/Cookie.d.ts +0 -123
- package/build/src/lib/cookies/Cookie.js +0 -257
- package/build/src/lib/cookies/Cookie.js.map +0 -1
- package/build/src/lib/cookies/Cookies.d.ts +0 -90
- package/build/src/lib/cookies/Cookies.js +0 -310
- package/build/src/lib/cookies/Cookies.js.map +0 -1
- package/build/src/lib/cookies/Utils.d.ts +0 -47
- package/build/src/lib/cookies/Utils.js +0 -163
- package/build/src/lib/cookies/Utils.js.map +0 -1
- package/build/src/mocking/lib/Arc.d.ts +0 -9
- package/build/src/mocking/lib/Arc.js +0 -24
- package/build/src/mocking/lib/Arc.js.map +0 -1
- package/build/src/models/RequestActions.d.ts +0 -65
- package/build/src/models/RequestActions.js +0 -114
- package/build/src/models/RequestActions.js.map +0 -1
- package/build/src/models/actions/Action.d.ts +0 -75
- package/build/src/models/actions/Action.js +0 -188
- package/build/src/models/actions/Action.js.map +0 -1
- package/build/src/models/actions/ActionView.d.ts +0 -15
- package/build/src/models/actions/ActionView.js +0 -33
- package/build/src/models/actions/ActionView.js.map +0 -1
- package/build/src/models/actions/Condition.d.ts +0 -81
- package/build/src/models/actions/Condition.js +0 -185
- package/build/src/models/actions/Condition.js.map +0 -1
- package/build/src/models/actions/ConditionView.d.ts +0 -17
- package/build/src/models/actions/ConditionView.js +0 -34
- package/build/src/models/actions/ConditionView.js.map +0 -1
- package/build/src/models/actions/Enums.d.ts +0 -26
- package/build/src/models/actions/Enums.js +0 -31
- package/build/src/models/actions/Enums.js.map +0 -1
- package/build/src/models/actions/RunnableAction.d.ts +0 -59
- package/build/src/models/actions/RunnableAction.js +0 -106
- package/build/src/models/actions/RunnableAction.js.map +0 -1
- package/build/src/models/actions/runnable/DeleteCookieAction.d.ts +0 -44
- package/build/src/models/actions/runnable/DeleteCookieAction.js +0 -92
- package/build/src/models/actions/runnable/DeleteCookieAction.js.map +0 -1
- package/build/src/models/actions/runnable/Runnable.d.ts +0 -8
- package/build/src/models/actions/runnable/Runnable.js +0 -4
- package/build/src/models/actions/runnable/Runnable.js.map +0 -1
- package/build/src/models/actions/runnable/SetCookieAction.d.ts +0 -87
- package/build/src/models/actions/runnable/SetCookieAction.js +0 -176
- package/build/src/models/actions/runnable/SetCookieAction.js.map +0 -1
- package/build/src/models/actions/runnable/SetVariableAction.d.ts +0 -31
- package/build/src/models/actions/runnable/SetVariableAction.js +0 -63
- package/build/src/models/actions/runnable/SetVariableAction.js.map +0 -1
- package/build/src/models/actions/runnable/index.d.ts +0 -7
- package/build/src/models/actions/runnable/index.js +0 -2
- package/build/src/models/actions/runnable/index.js.map +0 -1
- package/build/src/models/arc/ArcHttpRequest.d.ts +0 -40
- package/build/src/models/arc/ArcHttpRequest.js.map +0 -1
- package/build/src/models/arc/ArcProject.js.map +0 -1
- package/build/src/runtime/actions/ActionRunner.d.ts +0 -17
- package/build/src/runtime/actions/ActionRunner.js +0 -74
- package/build/src/runtime/actions/ActionRunner.js.map +0 -1
- package/build/src/runtime/actions/ConditionRunner.js.map +0 -1
- package/build/src/runtime/actions/RunnableCondition.d.ts +0 -27
- package/build/src/runtime/actions/RunnableCondition.js +0 -50
- package/build/src/runtime/actions/RunnableCondition.js.map +0 -1
- package/build/src/runtime/actions/runnable/ActionRunnable.d.ts +0 -13
- package/build/src/runtime/actions/runnable/ActionRunnable.js +0 -13
- package/build/src/runtime/actions/runnable/ActionRunnable.js.map +0 -1
- package/build/src/runtime/actions/runnable/DeleteCookieRunnable.d.ts +0 -7
- package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js +0 -36
- package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js.map +0 -1
- package/build/src/runtime/actions/runnable/SetCookieRunnable.d.ts +0 -10
- package/build/src/runtime/actions/runnable/SetCookieRunnable.js +0 -89
- package/build/src/runtime/actions/runnable/SetCookieRunnable.js.map +0 -1
- package/build/src/runtime/actions/runnable/SetVariableRunnable.d.ts +0 -10
- package/build/src/runtime/actions/runnable/SetVariableRunnable.js +0 -49
- package/build/src/runtime/actions/runnable/SetVariableRunnable.js.map +0 -1
- package/build/src/runtime/modules/BasicAuthCache.d.ts +0 -39
- package/build/src/runtime/modules/BasicAuthCache.js +0 -122
- package/build/src/runtime/modules/BasicAuthCache.js.map +0 -1
- package/build/src/runtime/modules/ExecutionResponse.d.ts +0 -4
- package/build/src/runtime/modules/ExecutionResponse.js +0 -6
- package/build/src/runtime/modules/ExecutionResponse.js.map +0 -1
- package/build/src/runtime/modules/ModulesRegistry.d.ts +0 -93
- package/build/src/runtime/modules/ModulesRegistry.js +0 -69
- package/build/src/runtime/modules/ModulesRegistry.js.map +0 -1
- package/build/src/runtime/modules/RequestAuthorization.d.ts +0 -6
- package/build/src/runtime/modules/RequestAuthorization.js +0 -110
- package/build/src/runtime/modules/RequestAuthorization.js.map +0 -1
- package/build/src/runtime/modules/RequestCookies.d.ts +0 -17
- package/build/src/runtime/modules/RequestCookies.js +0 -134
- package/build/src/runtime/modules/RequestCookies.js.map +0 -1
- package/build/src/runtime/node/RequestFactory.js +0 -406
- package/build/src/runtime/node/RequestFactory.js.map +0 -1
- package/build/src/runtime/node/VariablesStore.d.ts +0 -9
- package/build/src/runtime/node/VariablesStore.js +0 -19
- package/build/src/runtime/node/VariablesStore.js.map +0 -1
- package/src/lib/cookies/Cookie.ts +0 -312
- package/src/lib/cookies/Cookies.ts +0 -326
- package/src/lib/cookies/Utils.ts +0 -168
- package/src/mocking/lib/Arc.ts +0 -28
- package/src/models/RequestActions.ts +0 -161
- package/src/models/actions/Action.ts +0 -213
- package/src/models/actions/ActionView.ts +0 -40
- package/src/models/actions/Condition.ts +0 -207
- package/src/models/actions/ConditionView.ts +0 -42
- package/src/models/actions/Enums.ts +0 -29
- package/src/models/actions/RunnableAction.ts +0 -144
- package/src/models/actions/runnable/DeleteCookieAction.ts +0 -113
- package/src/models/actions/runnable/Runnable.ts +0 -9
- package/src/models/actions/runnable/SetCookieAction.ts +0 -216
- package/src/models/actions/runnable/SetVariableAction.ts +0 -81
- package/src/models/arc/ArcHttpRequest.ts +0 -129
- package/src/models/arc/readme.md +0 -3
- package/src/runtime/actions/ActionRunner.ts +0 -83
- package/src/runtime/actions/RunnableCondition.ts +0 -56
- package/src/runtime/actions/runnable/ActionRunnable.ts +0 -19
- package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +0 -39
- package/src/runtime/actions/runnable/SetCookieRunnable.ts +0 -92
- package/src/runtime/actions/runnable/SetVariableRunnable.ts +0 -53
- package/src/runtime/modules/BasicAuthCache.ts +0 -129
- package/src/runtime/modules/ExecutionResponse.ts +0 -4
- package/src/runtime/modules/ModulesRegistry.ts +0 -136
- package/src/runtime/modules/RequestAuthorization.ts +0 -106
- package/src/runtime/modules/RequestCookies.ts +0 -146
- package/src/runtime/node/RequestFactory.ts +0 -432
- package/src/runtime/node/VariablesStore.ts +0 -25
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { RunnableAction, Kind as RunnableActionKind } from './actions/RunnableAction.js';
|
|
2
|
-
export class RequestActions {
|
|
3
|
-
/**
|
|
4
|
-
* Actions to be executed before the request is sent to the transport library.
|
|
5
|
-
*/
|
|
6
|
-
request;
|
|
7
|
-
/**
|
|
8
|
-
* Actions to be executed after the response is fully received but before it is reported back to the application.
|
|
9
|
-
*/
|
|
10
|
-
response;
|
|
11
|
-
static fromLegacy(action) {
|
|
12
|
-
const { request, response } = action;
|
|
13
|
-
const init = {};
|
|
14
|
-
if (Array.isArray(request) && request.length) {
|
|
15
|
-
init.request = request.map(i => RunnableAction.fromLegacy(i).toJSON());
|
|
16
|
-
}
|
|
17
|
-
if (Array.isArray(response) && response.length) {
|
|
18
|
-
init.response = response.map(i => RunnableAction.fromLegacy(i).toJSON());
|
|
19
|
-
}
|
|
20
|
-
return new RequestActions(init);
|
|
21
|
-
}
|
|
22
|
-
static isLegacy(input) {
|
|
23
|
-
const { request = [], response = [] } = input;
|
|
24
|
-
if (!request.length && !response.length) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
if (request[0]) {
|
|
28
|
-
const r = request[0];
|
|
29
|
-
if (r.kind === RunnableActionKind) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (response[0]) {
|
|
34
|
-
const r = response[0];
|
|
35
|
-
if (r.kind === RunnableActionKind) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @param input The request actions definition used to restore the state.
|
|
43
|
-
*/
|
|
44
|
-
constructor(input) {
|
|
45
|
-
let init;
|
|
46
|
-
if (typeof input === 'string') {
|
|
47
|
-
init = JSON.parse(input);
|
|
48
|
-
}
|
|
49
|
-
else if (typeof input === 'object') {
|
|
50
|
-
init = input;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
init = {};
|
|
54
|
-
}
|
|
55
|
-
this.new(init);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Creates a new request actions clearing anything that is so far defined.
|
|
59
|
-
*/
|
|
60
|
-
new(init) {
|
|
61
|
-
const { request, response } = init;
|
|
62
|
-
if (request) {
|
|
63
|
-
this.request = request.map(i => new RunnableAction(i));
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
this.request = undefined;
|
|
67
|
-
}
|
|
68
|
-
if (response) {
|
|
69
|
-
this.response = response.map(i => new RunnableAction(i));
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
this.response = undefined;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
toJSON() {
|
|
76
|
-
const result = {};
|
|
77
|
-
if (this.request) {
|
|
78
|
-
result.request = this.request.map(i => i.toJSON());
|
|
79
|
-
}
|
|
80
|
-
if (this.response) {
|
|
81
|
-
result.response = this.response.map(i => i.toJSON());
|
|
82
|
-
}
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
addRequestAction(action) {
|
|
86
|
-
if (!Array.isArray(this.request)) {
|
|
87
|
-
this.request = [];
|
|
88
|
-
}
|
|
89
|
-
let finalAction;
|
|
90
|
-
if (action instanceof RunnableAction) {
|
|
91
|
-
finalAction = action;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
finalAction = new RunnableAction(action);
|
|
95
|
-
}
|
|
96
|
-
this.request.push(finalAction);
|
|
97
|
-
return finalAction;
|
|
98
|
-
}
|
|
99
|
-
addResponseAction(action) {
|
|
100
|
-
if (!Array.isArray(this.response)) {
|
|
101
|
-
this.response = [];
|
|
102
|
-
}
|
|
103
|
-
let finalAction;
|
|
104
|
-
if (action instanceof RunnableAction) {
|
|
105
|
-
finalAction = action;
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
finalAction = new RunnableAction(action);
|
|
109
|
-
}
|
|
110
|
-
this.response.push(finalAction);
|
|
111
|
-
return finalAction;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=RequestActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestActions.js","sourceRoot":"","sources":["../../../src/models/RequestActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,cAAc,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAc1G,MAAM,OAAO,cAAc;IACzB;;OAEG;IACH,OAAO,CAAoB;IAC3B;;OAEG;IACH,QAAQ,CAAoB;IAE5B,MAAM,CAAC,UAAU,CAAC,MAA4B;QAC5C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QACrC,MAAM,IAAI,GAAoB,EAAE,CAAC;QACjC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;YAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SACxE;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE;YAC9C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SAC1E;QACD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,KAAc;QAC5B,MAAM,EAAE,OAAO,GAAC,EAAE,EAAE,QAAQ,GAAC,EAAE,EAAE,GAAG,KAAuB,CAAC;QAC5D,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACvC,OAAO,KAAK,CAAC;SACd;QAC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QAChC,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Runnable } from './runnable/Runnable.js';
|
|
2
|
-
import { Action as LegacyAction } from '../legacy/actions/Actions.js';
|
|
3
|
-
export declare const Kind = "Core#Action";
|
|
4
|
-
/**
|
|
5
|
-
* An interface representing a single action.
|
|
6
|
-
*/
|
|
7
|
-
export interface IAction {
|
|
8
|
-
kind?: typeof Kind;
|
|
9
|
-
/**
|
|
10
|
-
* Action name.
|
|
11
|
-
*/
|
|
12
|
-
name?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the action is enabled.
|
|
15
|
-
* An action is enabled by default.
|
|
16
|
-
* @default true
|
|
17
|
-
*/
|
|
18
|
-
enabled?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Action priority. The higher number the higher priority of execution.
|
|
21
|
-
*/
|
|
22
|
-
priority?: number;
|
|
23
|
-
/**
|
|
24
|
-
* The action configuration. The schema depends on the action type.
|
|
25
|
-
*/
|
|
26
|
-
config?: unknown;
|
|
27
|
-
/**
|
|
28
|
-
* Whether or not the action is executed synchronously to request / response
|
|
29
|
-
*/
|
|
30
|
-
sync?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Whether or not the request should fail when the action fails.
|
|
33
|
-
*/
|
|
34
|
-
failOnError?: boolean;
|
|
35
|
-
}
|
|
36
|
-
export declare class Action {
|
|
37
|
-
kind: string;
|
|
38
|
-
/**
|
|
39
|
-
* Action name.
|
|
40
|
-
*/
|
|
41
|
-
name?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Whether the action is enabled.
|
|
44
|
-
*/
|
|
45
|
-
enabled?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Action priority. The higher number the higher priority of execution.
|
|
48
|
-
*/
|
|
49
|
-
priority?: number;
|
|
50
|
-
/**
|
|
51
|
-
* Action configuration
|
|
52
|
-
*/
|
|
53
|
-
config?: Runnable;
|
|
54
|
-
/**
|
|
55
|
-
* Whether or not the action is executed synchronously to request / response
|
|
56
|
-
*/
|
|
57
|
-
sync?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Whether or not the request should fail when the action fails.
|
|
60
|
-
*/
|
|
61
|
-
failOnError?: boolean;
|
|
62
|
-
static fromLegacy(item: LegacyAction): Action;
|
|
63
|
-
/**
|
|
64
|
-
* Creates a default configuration of an action
|
|
65
|
-
*/
|
|
66
|
-
static defaultAction(): Action;
|
|
67
|
-
constructor(input?: string | IAction);
|
|
68
|
-
new(init: IAction): void;
|
|
69
|
-
toJSON(): IAction;
|
|
70
|
-
setConfig(config: unknown): void;
|
|
71
|
-
/**
|
|
72
|
-
* The sort function for actions to sort them for the execution order.
|
|
73
|
-
*/
|
|
74
|
-
static sortActions(a: Action, b: Action): number;
|
|
75
|
-
}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { Kind as DeleteCookieKind, DeleteCookieAction } from './runnable/DeleteCookieAction.js';
|
|
2
|
-
import { Kind as SetCookieKind, SetCookieAction } from './runnable/SetCookieAction.js';
|
|
3
|
-
import { Kind as SetVariableKind, SetVariableAction } from './runnable/SetVariableAction.js';
|
|
4
|
-
export const Kind = 'Core#Action';
|
|
5
|
-
export class Action {
|
|
6
|
-
kind = Kind;
|
|
7
|
-
/**
|
|
8
|
-
* Action name.
|
|
9
|
-
*/
|
|
10
|
-
name;
|
|
11
|
-
/**
|
|
12
|
-
* Whether the action is enabled.
|
|
13
|
-
*/
|
|
14
|
-
enabled;
|
|
15
|
-
/**
|
|
16
|
-
* Action priority. The higher number the higher priority of execution.
|
|
17
|
-
*/
|
|
18
|
-
priority;
|
|
19
|
-
/**
|
|
20
|
-
* Action configuration
|
|
21
|
-
*/
|
|
22
|
-
config;
|
|
23
|
-
/**
|
|
24
|
-
* Whether or not the action is executed synchronously to request / response
|
|
25
|
-
*/
|
|
26
|
-
sync;
|
|
27
|
-
/**
|
|
28
|
-
* Whether or not the request should fail when the action fails.
|
|
29
|
-
*/
|
|
30
|
-
failOnError;
|
|
31
|
-
static fromLegacy(item) {
|
|
32
|
-
const { priority, config, enabled, failOnError, name, sync } = item;
|
|
33
|
-
let newConfig;
|
|
34
|
-
switch (name) {
|
|
35
|
-
case 'set-cookie':
|
|
36
|
-
newConfig = SetCookieAction.fromLegacy(config).toJSON();
|
|
37
|
-
break;
|
|
38
|
-
case 'set-variable':
|
|
39
|
-
newConfig = SetVariableAction.fromLegacy(config);
|
|
40
|
-
break;
|
|
41
|
-
case 'delete-cookie':
|
|
42
|
-
newConfig = DeleteCookieAction.fromLegacy(config);
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
const init = {
|
|
46
|
-
kind: Kind,
|
|
47
|
-
priority,
|
|
48
|
-
};
|
|
49
|
-
if (typeof enabled === 'boolean') {
|
|
50
|
-
init.enabled = enabled;
|
|
51
|
-
}
|
|
52
|
-
if (typeof failOnError === 'boolean') {
|
|
53
|
-
init.failOnError = failOnError;
|
|
54
|
-
}
|
|
55
|
-
if (typeof sync === 'boolean') {
|
|
56
|
-
init.sync = sync;
|
|
57
|
-
}
|
|
58
|
-
if (typeof name === 'string') {
|
|
59
|
-
init.name = name;
|
|
60
|
-
}
|
|
61
|
-
if (newConfig) {
|
|
62
|
-
init.config = newConfig;
|
|
63
|
-
}
|
|
64
|
-
return new Action(init);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Creates a default configuration of an action
|
|
68
|
-
*/
|
|
69
|
-
static defaultAction() {
|
|
70
|
-
const init = {
|
|
71
|
-
name: 'New action',
|
|
72
|
-
failOnError: false,
|
|
73
|
-
priority: 0,
|
|
74
|
-
sync: false,
|
|
75
|
-
enabled: true,
|
|
76
|
-
};
|
|
77
|
-
return new Action(init);
|
|
78
|
-
}
|
|
79
|
-
constructor(input) {
|
|
80
|
-
let init;
|
|
81
|
-
if (typeof input === 'string') {
|
|
82
|
-
init = JSON.parse(input);
|
|
83
|
-
}
|
|
84
|
-
else if (typeof input === 'object') {
|
|
85
|
-
init = input;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
init = {
|
|
89
|
-
kind: Kind,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
this.new(init);
|
|
93
|
-
}
|
|
94
|
-
new(init) {
|
|
95
|
-
const { name, enabled, priority, sync, failOnError, config } = init;
|
|
96
|
-
this.kind = Kind;
|
|
97
|
-
if (name) {
|
|
98
|
-
this.name = name;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
this.name = undefined;
|
|
102
|
-
}
|
|
103
|
-
if (typeof enabled === 'boolean') {
|
|
104
|
-
this.enabled = enabled;
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this.enabled = undefined;
|
|
108
|
-
}
|
|
109
|
-
if (typeof sync === 'boolean') {
|
|
110
|
-
this.sync = sync;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
this.sync = undefined;
|
|
114
|
-
}
|
|
115
|
-
if (typeof failOnError === 'boolean') {
|
|
116
|
-
this.failOnError = failOnError;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
this.failOnError = undefined;
|
|
120
|
-
}
|
|
121
|
-
if (typeof priority === 'number') {
|
|
122
|
-
this.priority = priority;
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
this.priority = undefined;
|
|
126
|
-
}
|
|
127
|
-
if (config) {
|
|
128
|
-
this.setConfig(config);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
this.config = undefined;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
toJSON() {
|
|
135
|
-
const result = {
|
|
136
|
-
kind: Kind,
|
|
137
|
-
};
|
|
138
|
-
if (this.name) {
|
|
139
|
-
result.name = this.name;
|
|
140
|
-
}
|
|
141
|
-
if (this.config) {
|
|
142
|
-
result.config = this.config.toJSON();
|
|
143
|
-
}
|
|
144
|
-
if (typeof this.enabled === 'boolean') {
|
|
145
|
-
result.enabled = this.enabled;
|
|
146
|
-
}
|
|
147
|
-
if (typeof this.sync === 'boolean') {
|
|
148
|
-
result.sync = this.sync;
|
|
149
|
-
}
|
|
150
|
-
if (typeof this.failOnError === 'boolean') {
|
|
151
|
-
result.failOnError = this.failOnError;
|
|
152
|
-
}
|
|
153
|
-
if (typeof this.priority === 'number') {
|
|
154
|
-
result.priority = this.priority;
|
|
155
|
-
}
|
|
156
|
-
return result;
|
|
157
|
-
}
|
|
158
|
-
setConfig(config) {
|
|
159
|
-
const { kind } = config;
|
|
160
|
-
switch (kind) {
|
|
161
|
-
case DeleteCookieKind:
|
|
162
|
-
this.config = new DeleteCookieAction(config);
|
|
163
|
-
break;
|
|
164
|
-
case SetCookieKind:
|
|
165
|
-
this.config = new SetCookieAction(config);
|
|
166
|
-
break;
|
|
167
|
-
case SetVariableKind:
|
|
168
|
-
this.config = new SetVariableAction(config);
|
|
169
|
-
break;
|
|
170
|
-
default: throw new Error(`Unknown action config.`);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* The sort function for actions to sort them for the execution order.
|
|
175
|
-
*/
|
|
176
|
-
static sortActions(a, b) {
|
|
177
|
-
const { priority: p1 = 0 } = a;
|
|
178
|
-
const { priority: p2 = 0 } = b;
|
|
179
|
-
if (p1 > p2) {
|
|
180
|
-
return 1;
|
|
181
|
-
}
|
|
182
|
-
if (p2 > p1) {
|
|
183
|
-
return -1;
|
|
184
|
-
}
|
|
185
|
-
return 0;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
//# sourceMappingURL=Action.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/models/actions/Action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,kBAAkB,EAAuB,MAAM,kCAAkC,CAAC;AACrH,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,eAAe,EAAoB,MAAM,+BAA+B,CAAC;AACzG,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KAAK,QAAQ,EAAE;YACrC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;SACjC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,MAAe;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAmB,CAAC;QACrC,QAAQ,IAAI,EAAE;YACZ,KAAK,gBAAgB;gBAAE,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAkB,CAAC,MAA6B,CAAC,CAAC;gBAAC,MAAM;YAClG,KAAK,aAAa;gBAAE,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,MAA0B,CAAC,CAAC;gBAAC,MAAM;YACzF,KAAK,eAAe;gBAAE,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAiB,CAAC,MAA4B,CAAC,CAAC;gBAAC,MAAM;YAC/F,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;SACnD;IACH,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,CAAS,EAAE,CAAS;QACrC,MAAM,EAAE,QAAQ,EAAE,EAAE,GAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC7B,MAAM,EAAE,QAAQ,EAAE,EAAE,GAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC7B,IAAI,EAAE,GAAG,EAAE,EAAE;YACX,OAAO,CAAC,CAAC;SACV;QACD,IAAI,EAAE,GAAG,EAAE,EAAE;YACX,OAAO,CAAC,CAAC,CAAC;SACX;QACD,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface IActionView {
|
|
2
|
-
/**
|
|
3
|
-
* Whether the action is "opened" in the editor UI.
|
|
4
|
-
*/
|
|
5
|
-
opened?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare class ActionView {
|
|
8
|
-
/**
|
|
9
|
-
* Whether the action is "opened" in the editor UI.
|
|
10
|
-
*/
|
|
11
|
-
opened?: boolean;
|
|
12
|
-
constructor(input?: string | IActionView);
|
|
13
|
-
new(init: IActionView): void;
|
|
14
|
-
toJSON(): IActionView;
|
|
15
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export class ActionView {
|
|
2
|
-
/**
|
|
3
|
-
* Whether the action is "opened" in the editor UI.
|
|
4
|
-
*/
|
|
5
|
-
opened;
|
|
6
|
-
constructor(input) {
|
|
7
|
-
let init;
|
|
8
|
-
if (typeof input === 'string') {
|
|
9
|
-
init = JSON.parse(input);
|
|
10
|
-
}
|
|
11
|
-
else if (typeof input === 'object') {
|
|
12
|
-
init = input;
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
init = {
|
|
16
|
-
opened: false,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
this.new(init);
|
|
20
|
-
}
|
|
21
|
-
new(init) {
|
|
22
|
-
const { opened = false } = init;
|
|
23
|
-
this.opened = opened;
|
|
24
|
-
}
|
|
25
|
-
toJSON() {
|
|
26
|
-
const result = {};
|
|
27
|
-
if (typeof this.opened === 'boolean') {
|
|
28
|
-
result.opened = this.opened;
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=ActionView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionView.js","sourceRoot":"","sources":["../../../../src/models/actions/ActionView.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,UAAU;IACrB;;OAEG;IACH,MAAM,CAAW;IAEjB,YAAY,KAA0B;QACpC,IAAI,IAAiB,CAAC;QACtB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1B;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,IAAI,GAAG,KAAK,CAAC;SACd;aAAM;YACL,IAAI,GAAG;gBACL,MAAM,EAAE,KAAK;aACd,CAAC;SACH;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,GAAG,CAAC,IAAiB;QACnB,MAAM,EAAE,MAAM,GAAC,KAAK,EAAE,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAgB,EAAE,CAAC;QAC/B,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;YACpC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { ActionTypeEnum, RequestDataSourceEnum, ResponseDataSourceEnum, OperatorEnum } from './Enums.js';
|
|
2
|
-
import { Condition as LegacyCondition } from '../legacy/actions/Actions.js';
|
|
3
|
-
export declare const Kind = "Core#Condition";
|
|
4
|
-
/**
|
|
5
|
-
* A base interface describing a configuration to extract data from a request or a response.
|
|
6
|
-
*/
|
|
7
|
-
export interface IDataSource {
|
|
8
|
-
/**
|
|
9
|
-
* The main data source. Either the request or the response object.
|
|
10
|
-
* This is required when the `source` is not equal to `value. In this case it is ignored
|
|
11
|
-
*/
|
|
12
|
-
type?: ActionTypeEnum;
|
|
13
|
-
/**
|
|
14
|
-
* Source of the data.
|
|
15
|
-
*/
|
|
16
|
-
source: RequestDataSourceEnum | ResponseDataSourceEnum | 'value';
|
|
17
|
-
/**
|
|
18
|
-
* The path to the data.
|
|
19
|
-
* For JSON value use https://jmespath.org/ syntax.
|
|
20
|
-
* For XML use xpath.
|
|
21
|
-
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
22
|
-
*/
|
|
23
|
-
path?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Only used when the `source` is `value`. The data extraction always returns this value.
|
|
26
|
-
*/
|
|
27
|
-
value?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Describes action's condition configuration.
|
|
31
|
-
*/
|
|
32
|
-
export interface ICondition extends IDataSource {
|
|
33
|
-
kind: typeof Kind;
|
|
34
|
-
/**
|
|
35
|
-
* The comparison operator.
|
|
36
|
-
*/
|
|
37
|
-
operator?: OperatorEnum;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the condition always pass.
|
|
40
|
-
* The condition is not really checked, values can be empty. The condition check always returns `true`.
|
|
41
|
-
*/
|
|
42
|
-
alwaysPass?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export declare class Condition {
|
|
45
|
-
kind: string;
|
|
46
|
-
/**
|
|
47
|
-
* The main data source. Either the request or the response object.
|
|
48
|
-
* This is required when the `source` is not equal to `value. In this case it is ignored
|
|
49
|
-
*/
|
|
50
|
-
type?: ActionTypeEnum;
|
|
51
|
-
/**
|
|
52
|
-
* Source of the data.
|
|
53
|
-
*/
|
|
54
|
-
source: RequestDataSourceEnum | ResponseDataSourceEnum | 'value';
|
|
55
|
-
/**
|
|
56
|
-
* The path to the data.
|
|
57
|
-
* For JSON value use https://jmespath.org/ syntax.
|
|
58
|
-
* For XML use xpath.
|
|
59
|
-
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
60
|
-
*/
|
|
61
|
-
path?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Only used when the `source` is `value`. The data extraction always returns this value.
|
|
64
|
-
*/
|
|
65
|
-
value?: string;
|
|
66
|
-
/**
|
|
67
|
-
* The comparison operator.
|
|
68
|
-
*/
|
|
69
|
-
operator?: OperatorEnum;
|
|
70
|
-
/**
|
|
71
|
-
* Whether the condition always pass.
|
|
72
|
-
* The condition is not really checked, values can be empty. The condition check always returns `true`.
|
|
73
|
-
*/
|
|
74
|
-
alwaysPass?: boolean;
|
|
75
|
-
static defaultCondition(type?: ActionTypeEnum): Condition;
|
|
76
|
-
static fromLegacy(runnable: LegacyCondition): Condition;
|
|
77
|
-
static alwaysPass(type?: ActionTypeEnum): Condition;
|
|
78
|
-
constructor(input?: string | ICondition);
|
|
79
|
-
new(init: ICondition): void;
|
|
80
|
-
toJSON(): ICondition;
|
|
81
|
-
}
|