@api-client/core 0.6.30 → 0.7.1
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 -10
- package/build/src/mocking/lib/Arc.js +0 -31
- 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 -34
- 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,207 +0,0 @@
|
|
|
1
|
-
import { ActionTypeEnum, RequestDataSourceEnum, ResponseDataSourceEnum, OperatorEnum } from './Enums.js';
|
|
2
|
-
import { Condition as LegacyCondition } from '../legacy/actions/Actions.js';
|
|
3
|
-
|
|
4
|
-
export const Kind = 'Core#Condition';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A base interface describing a configuration to extract data from a request or a response.
|
|
8
|
-
*/
|
|
9
|
-
export interface IDataSource {
|
|
10
|
-
/**
|
|
11
|
-
* The main data source. Either the request or the response object.
|
|
12
|
-
* This is required when the `source` is not equal to `value. In this case it is ignored
|
|
13
|
-
*/
|
|
14
|
-
type?: ActionTypeEnum;
|
|
15
|
-
/**
|
|
16
|
-
* Source of the data.
|
|
17
|
-
*/
|
|
18
|
-
source: RequestDataSourceEnum | ResponseDataSourceEnum | 'value';
|
|
19
|
-
/**
|
|
20
|
-
* The path to the data.
|
|
21
|
-
* For JSON value use https://jmespath.org/ syntax.
|
|
22
|
-
* For XML use xpath.
|
|
23
|
-
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
24
|
-
*/
|
|
25
|
-
path?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Only used when the `source` is `value`. The data extraction always returns this value.
|
|
28
|
-
*/
|
|
29
|
-
value?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Describes action's condition configuration.
|
|
34
|
-
*/
|
|
35
|
-
export interface ICondition extends IDataSource {
|
|
36
|
-
kind: typeof Kind,
|
|
37
|
-
/**
|
|
38
|
-
* The comparison operator.
|
|
39
|
-
*/
|
|
40
|
-
operator?: OperatorEnum;
|
|
41
|
-
/**
|
|
42
|
-
* Whether the condition always pass.
|
|
43
|
-
* The condition is not really checked, values can be empty. The condition check always returns `true`.
|
|
44
|
-
*/
|
|
45
|
-
alwaysPass?: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export class Condition {
|
|
49
|
-
kind = Kind;
|
|
50
|
-
/**
|
|
51
|
-
* The main data source. Either the request or the response object.
|
|
52
|
-
* This is required when the `source` is not equal to `value. In this case it is ignored
|
|
53
|
-
*/
|
|
54
|
-
type?: ActionTypeEnum;
|
|
55
|
-
/**
|
|
56
|
-
* Source of the data.
|
|
57
|
-
*/
|
|
58
|
-
source: RequestDataSourceEnum | ResponseDataSourceEnum | 'value' = RequestDataSourceEnum.url;
|
|
59
|
-
/**
|
|
60
|
-
* The path to the data.
|
|
61
|
-
* For JSON value use https://jmespath.org/ syntax.
|
|
62
|
-
* For XML use xpath.
|
|
63
|
-
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
64
|
-
*/
|
|
65
|
-
path?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Only used when the `source` is `value`. The data extraction always returns this value.
|
|
68
|
-
*/
|
|
69
|
-
value?: string;
|
|
70
|
-
/**
|
|
71
|
-
* The comparison operator.
|
|
72
|
-
*/
|
|
73
|
-
operator?: OperatorEnum;
|
|
74
|
-
/**
|
|
75
|
-
* Whether the condition always pass.
|
|
76
|
-
* The condition is not really checked, values can be empty. The condition check always returns `true`.
|
|
77
|
-
*/
|
|
78
|
-
alwaysPass?: boolean;
|
|
79
|
-
|
|
80
|
-
static defaultCondition(type=ActionTypeEnum.response): Condition {
|
|
81
|
-
const init: ICondition = {
|
|
82
|
-
kind: Kind,
|
|
83
|
-
type,
|
|
84
|
-
source: RequestDataSourceEnum.url,
|
|
85
|
-
operator: OperatorEnum.equal,
|
|
86
|
-
path: '',
|
|
87
|
-
alwaysPass: false,
|
|
88
|
-
};
|
|
89
|
-
return new Condition(init);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
static fromLegacy(runnable: LegacyCondition): Condition {
|
|
93
|
-
const { source, alwaysPass, operator, path, predictedValue, type, value } = runnable;
|
|
94
|
-
const init: ICondition = {
|
|
95
|
-
kind: Kind,
|
|
96
|
-
source: source as RequestDataSourceEnum | ResponseDataSourceEnum | 'value',
|
|
97
|
-
};
|
|
98
|
-
if (typeof alwaysPass === 'boolean') {
|
|
99
|
-
init.alwaysPass = alwaysPass;
|
|
100
|
-
}
|
|
101
|
-
if (typeof path === 'string') {
|
|
102
|
-
init.path = path;
|
|
103
|
-
}
|
|
104
|
-
if (path === 'value') {
|
|
105
|
-
init.value = String(value);
|
|
106
|
-
} else {
|
|
107
|
-
init.value = String(predictedValue);
|
|
108
|
-
}
|
|
109
|
-
if (operator) {
|
|
110
|
-
switch (operator) {
|
|
111
|
-
case 'contains': init.operator = OperatorEnum.contains; break;
|
|
112
|
-
case 'equal': init.operator = OperatorEnum.equal; break;
|
|
113
|
-
case 'greater-than': init.operator = OperatorEnum.greaterThan; break;
|
|
114
|
-
case 'greater-than-equal': init.operator = OperatorEnum.greaterThanEqual; break;
|
|
115
|
-
case 'less-than': init.operator = OperatorEnum.lessThan; break;
|
|
116
|
-
case 'less-than-equal': init.operator = OperatorEnum.lessThanEqual; break;
|
|
117
|
-
case 'not-equal': init.operator = OperatorEnum.notEqual; break;
|
|
118
|
-
case 'regex': init.operator = OperatorEnum.regex; break;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
if (type) {
|
|
122
|
-
switch (type) {
|
|
123
|
-
case 'request': init.type = ActionTypeEnum.request; break;
|
|
124
|
-
case 'response': init.type = ActionTypeEnum.response; break;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return new Condition(init);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
static alwaysPass(type=ActionTypeEnum.request): Condition {
|
|
131
|
-
const init: ICondition = {
|
|
132
|
-
kind: Kind,
|
|
133
|
-
type,
|
|
134
|
-
source: 'value',
|
|
135
|
-
alwaysPass: true,
|
|
136
|
-
};
|
|
137
|
-
return new Condition(init);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
constructor(input?: string | ICondition) {
|
|
141
|
-
let init: ICondition;
|
|
142
|
-
if (typeof input === 'string') {
|
|
143
|
-
init = JSON.parse(input);
|
|
144
|
-
} else if (typeof input === 'object') {
|
|
145
|
-
init = input;
|
|
146
|
-
} else {
|
|
147
|
-
init = {
|
|
148
|
-
kind: Kind,
|
|
149
|
-
source: RequestDataSourceEnum.url,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
this.new(init);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
new(init: ICondition): void {
|
|
156
|
-
const { source = RequestDataSourceEnum.url, alwaysPass, operator, path, type, value } = init;
|
|
157
|
-
this.source = source;
|
|
158
|
-
if (typeof alwaysPass === 'boolean') {
|
|
159
|
-
this.alwaysPass = alwaysPass;
|
|
160
|
-
} else {
|
|
161
|
-
this.alwaysPass = undefined;
|
|
162
|
-
}
|
|
163
|
-
if (operator) {
|
|
164
|
-
this.operator = operator;
|
|
165
|
-
} else {
|
|
166
|
-
this.operator = undefined;
|
|
167
|
-
}
|
|
168
|
-
if (typeof path === 'string') {
|
|
169
|
-
this.path = path;
|
|
170
|
-
} else {
|
|
171
|
-
this.path = undefined;
|
|
172
|
-
}
|
|
173
|
-
if (type) {
|
|
174
|
-
this.type = type;
|
|
175
|
-
} else {
|
|
176
|
-
this.type = undefined;
|
|
177
|
-
}
|
|
178
|
-
if (value) {
|
|
179
|
-
this.value = value;
|
|
180
|
-
} else {
|
|
181
|
-
this.value = undefined;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
toJSON(): ICondition {
|
|
186
|
-
const result: ICondition = {
|
|
187
|
-
source: this.source,
|
|
188
|
-
kind: Kind,
|
|
189
|
-
};
|
|
190
|
-
if (this.type) {
|
|
191
|
-
result.type = this.type;
|
|
192
|
-
}
|
|
193
|
-
if (this.path) {
|
|
194
|
-
result.path = this.path;
|
|
195
|
-
}
|
|
196
|
-
if (this.value) {
|
|
197
|
-
result.value = this.value;
|
|
198
|
-
}
|
|
199
|
-
if (this.operator) {
|
|
200
|
-
result.operator = this.operator;
|
|
201
|
-
}
|
|
202
|
-
if (typeof this.alwaysPass === 'boolean') {
|
|
203
|
-
result.alwaysPass = this.alwaysPass;
|
|
204
|
-
}
|
|
205
|
-
return result;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export interface IConditionView {
|
|
2
|
-
/**
|
|
3
|
-
* Whether the condition editor is rendered in the "full" view
|
|
4
|
-
* instead of the summary.
|
|
5
|
-
*/
|
|
6
|
-
opened?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class ConditionView {
|
|
10
|
-
/**
|
|
11
|
-
* Whether the condition editor is rendered in the "full" view
|
|
12
|
-
* instead of the summary.
|
|
13
|
-
*/
|
|
14
|
-
opened?: boolean;
|
|
15
|
-
|
|
16
|
-
constructor(input?: string|IConditionView) {
|
|
17
|
-
let init: IConditionView;
|
|
18
|
-
if (typeof input === 'string') {
|
|
19
|
-
init = JSON.parse(input);
|
|
20
|
-
} else if (typeof input === 'object') {
|
|
21
|
-
init = input;
|
|
22
|
-
} else {
|
|
23
|
-
init = {
|
|
24
|
-
opened: false,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
this.new(init);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
new(init: IConditionView): void {
|
|
31
|
-
const { opened=false } = init;
|
|
32
|
-
this.opened = opened;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
toJSON(): IConditionView {
|
|
36
|
-
const result: IConditionView = {};
|
|
37
|
-
if (typeof this.opened === 'boolean') {
|
|
38
|
-
result.opened = this.opened;
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export enum ActionTypeEnum {
|
|
2
|
-
request = 'request',
|
|
3
|
-
response = 'response',
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export enum OperatorEnum {
|
|
7
|
-
equal = "equal",
|
|
8
|
-
notEqual = "not-equal",
|
|
9
|
-
greaterThan = "greater-than",
|
|
10
|
-
greaterThanEqual = "greater-than-equal",
|
|
11
|
-
lessThan = "less-than",
|
|
12
|
-
lessThanEqual = "less-than-equal",
|
|
13
|
-
contains = "contains",
|
|
14
|
-
regex = "regex",
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export enum RequestDataSourceEnum {
|
|
18
|
-
url = "url",
|
|
19
|
-
method = "method",
|
|
20
|
-
headers = "headers",
|
|
21
|
-
body = "body"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export enum ResponseDataSourceEnum {
|
|
25
|
-
url = "url",
|
|
26
|
-
status = "status",
|
|
27
|
-
headers = "headers",
|
|
28
|
-
body = "body"
|
|
29
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { ICondition, Condition } from './Condition.js';
|
|
2
|
-
import { IAction, Action } from './Action.js';
|
|
3
|
-
import { RunnableAction as LegacyRunnable } from '../legacy/actions/Actions.js';
|
|
4
|
-
|
|
5
|
-
export const Kind = 'Core#RunnableAction';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* An interface representing a runnable set of action in a condition.
|
|
9
|
-
* For the actions to be executed the condition first has to be met.
|
|
10
|
-
* The condition can be configured to always pass by setting the `alwaysPass` property.
|
|
11
|
-
*/
|
|
12
|
-
export interface IRunnableAction {
|
|
13
|
-
kind?: typeof Kind;
|
|
14
|
-
/**
|
|
15
|
-
* The condition to be checked when executing the runnable,
|
|
16
|
-
*/
|
|
17
|
-
condition: ICondition;
|
|
18
|
-
/**
|
|
19
|
-
* The list of actions to execute.
|
|
20
|
-
*/
|
|
21
|
-
actions: IAction[];
|
|
22
|
-
/**
|
|
23
|
-
* Whether the entire runnable is enabled. This is checked before the condition is executed.
|
|
24
|
-
* An action is enabled by default.
|
|
25
|
-
*/
|
|
26
|
-
enabled?: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export class RunnableAction {
|
|
30
|
-
kind = Kind;
|
|
31
|
-
/**
|
|
32
|
-
* The condition to be checked when executing the runnable,
|
|
33
|
-
*/
|
|
34
|
-
condition: Condition = new Condition();
|
|
35
|
-
/**
|
|
36
|
-
* The list of actions to execute.
|
|
37
|
-
*/
|
|
38
|
-
actions: Action[] = [];
|
|
39
|
-
/**
|
|
40
|
-
* Whether the entire runnable is enabled. This is checked before the condition is executed.
|
|
41
|
-
*/
|
|
42
|
-
enabled?: boolean;
|
|
43
|
-
|
|
44
|
-
static fromLegacy(runnable: LegacyRunnable): RunnableAction {
|
|
45
|
-
const result = new RunnableAction();
|
|
46
|
-
result.fromLegacy(runnable);
|
|
47
|
-
return result;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
constructor(input?: string | IRunnableAction) {
|
|
51
|
-
let init: IRunnableAction;
|
|
52
|
-
if (typeof input === 'string') {
|
|
53
|
-
init = JSON.parse(input);
|
|
54
|
-
} else if (typeof input === 'object') {
|
|
55
|
-
init = input;
|
|
56
|
-
} else {
|
|
57
|
-
init = {
|
|
58
|
-
kind: Kind,
|
|
59
|
-
condition: new Condition().toJSON(),
|
|
60
|
-
actions: [],
|
|
61
|
-
enabled: true,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
if (init.kind === Kind) {
|
|
65
|
-
this.new(init);
|
|
66
|
-
} else {
|
|
67
|
-
this.fromLegacy((init as unknown) as LegacyRunnable);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
new(init: IRunnableAction): void {
|
|
72
|
-
const { enabled, condition, actions } = init;
|
|
73
|
-
this.enabled = enabled;
|
|
74
|
-
if (condition) {
|
|
75
|
-
this.condition = new Condition(condition);
|
|
76
|
-
} else {
|
|
77
|
-
this.condition = new Condition();
|
|
78
|
-
}
|
|
79
|
-
if (Array.isArray(actions)) {
|
|
80
|
-
this.actions = actions.map(i => new Action(i));
|
|
81
|
-
} else {
|
|
82
|
-
this.actions = [];
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
toJSON(): IRunnableAction {
|
|
87
|
-
const result: IRunnableAction = {
|
|
88
|
-
condition: this.condition.toJSON(),
|
|
89
|
-
actions: this.actions.map(i => i.toJSON()),
|
|
90
|
-
kind: Kind,
|
|
91
|
-
};
|
|
92
|
-
if (typeof this.enabled === 'boolean') {
|
|
93
|
-
result.enabled = this.enabled;
|
|
94
|
-
}
|
|
95
|
-
return result;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
fromLegacy(runnable: LegacyRunnable): void {
|
|
99
|
-
const { actions, condition, enabled } = runnable;
|
|
100
|
-
if (typeof enabled === 'boolean') {
|
|
101
|
-
this.enabled = enabled;
|
|
102
|
-
}
|
|
103
|
-
if (condition) {
|
|
104
|
-
this.condition = Condition.fromLegacy(condition);
|
|
105
|
-
} else {
|
|
106
|
-
this.condition = new Condition();
|
|
107
|
-
}
|
|
108
|
-
if (Array.isArray(actions) && actions.length) {
|
|
109
|
-
this.actions = actions.map(i => Action.fromLegacy(i));
|
|
110
|
-
} else {
|
|
111
|
-
this.actions = [];
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Adds a new action to the list of runnable action.
|
|
117
|
-
*
|
|
118
|
-
* @param schema The schema of the action
|
|
119
|
-
* @returns Created instance of the action.
|
|
120
|
-
*/
|
|
121
|
-
addAction(schema: IAction): Action;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Adds a new action to the list of runnable action.
|
|
125
|
-
*
|
|
126
|
-
* @param schema The instance of the action
|
|
127
|
-
* @returns The same instance of the action.
|
|
128
|
-
*/
|
|
129
|
-
addAction(instance: Action): Action;
|
|
130
|
-
|
|
131
|
-
addAction(value: Action | IAction): Action {
|
|
132
|
-
if (!Array.isArray(this.actions)) {
|
|
133
|
-
this.actions = [];
|
|
134
|
-
}
|
|
135
|
-
let finalAction: Action;
|
|
136
|
-
if (value instanceof Action) {
|
|
137
|
-
finalAction = value;
|
|
138
|
-
} else {
|
|
139
|
-
finalAction = new Action(value);
|
|
140
|
-
}
|
|
141
|
-
this.actions.push(finalAction);
|
|
142
|
-
return finalAction;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { DeleteCookieConfig } from '../../legacy/actions/Actions.js';
|
|
2
|
-
import { Runnable, IRunnable } from './Runnable.js';
|
|
3
|
-
|
|
4
|
-
export const Kind = 'Core#DeleteCookieAction';
|
|
5
|
-
|
|
6
|
-
export interface IDeleteCookieAction extends IRunnable {
|
|
7
|
-
kind?: typeof Kind;
|
|
8
|
-
/**
|
|
9
|
-
* When set it uses request URL instead of defined URL in the action.
|
|
10
|
-
*/
|
|
11
|
-
useRequestUrl?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* An URL associated with the cookie.
|
|
14
|
-
* Only used when `useRequestUrl` is not `true`.
|
|
15
|
-
* Either `url` or `useRequestUrl` must be set for the action to be considered valid.
|
|
16
|
-
*/
|
|
17
|
-
url?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Name of the cookie to remove.
|
|
20
|
-
* When not set it removes all cookies.
|
|
21
|
-
*/
|
|
22
|
-
name?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export class DeleteCookieAction extends Runnable {
|
|
26
|
-
kind = Kind;
|
|
27
|
-
/**
|
|
28
|
-
* When set it uses request URL instead of defined URL in the action.
|
|
29
|
-
*/
|
|
30
|
-
useRequestUrl?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* An URL associated with the cookie.
|
|
33
|
-
* Only used when `useRequestUrl` is not `true`.
|
|
34
|
-
* Either `url` or `useRequestUrl` must be set for the action to be considered valid.
|
|
35
|
-
*/
|
|
36
|
-
url?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Name of the cookie to remove.
|
|
39
|
-
* When not set it removes all cookies.
|
|
40
|
-
*/
|
|
41
|
-
name?: string;
|
|
42
|
-
|
|
43
|
-
isValid(): boolean {
|
|
44
|
-
return !!this.useRequestUrl || !!this.url;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static fromLegacy(legacy: DeleteCookieConfig): DeleteCookieAction {
|
|
48
|
-
const init: IDeleteCookieAction = {
|
|
49
|
-
kind: Kind,
|
|
50
|
-
name: legacy.name,
|
|
51
|
-
};
|
|
52
|
-
if (legacy.url) {
|
|
53
|
-
init.url = legacy.url;
|
|
54
|
-
}
|
|
55
|
-
if (typeof legacy.useRequestUrl === 'boolean') {
|
|
56
|
-
init.useRequestUrl = legacy.useRequestUrl;
|
|
57
|
-
}
|
|
58
|
-
if (legacy.removeAll) {
|
|
59
|
-
delete init.name;
|
|
60
|
-
}
|
|
61
|
-
return new DeleteCookieAction(init);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
constructor(input?: string | IDeleteCookieAction) {
|
|
65
|
-
super();
|
|
66
|
-
let init: IDeleteCookieAction;
|
|
67
|
-
if (typeof input === 'string') {
|
|
68
|
-
init = JSON.parse(input);
|
|
69
|
-
} else if (typeof input === 'object') {
|
|
70
|
-
init = input;
|
|
71
|
-
} else {
|
|
72
|
-
init = {
|
|
73
|
-
kind: Kind,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
this.new(init);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
new(init: IDeleteCookieAction): void {
|
|
80
|
-
const { useRequestUrl, url, name } = init;
|
|
81
|
-
if (typeof useRequestUrl === 'boolean') {
|
|
82
|
-
this.useRequestUrl = useRequestUrl;
|
|
83
|
-
} else {
|
|
84
|
-
this.useRequestUrl = undefined;
|
|
85
|
-
}
|
|
86
|
-
if (url) {
|
|
87
|
-
this.url = url;
|
|
88
|
-
} else {
|
|
89
|
-
this.url = undefined;
|
|
90
|
-
}
|
|
91
|
-
if (name) {
|
|
92
|
-
this.name = name;
|
|
93
|
-
} else {
|
|
94
|
-
this.name = undefined;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
toJSON(): IDeleteCookieAction {
|
|
99
|
-
const result: IDeleteCookieAction = {
|
|
100
|
-
kind: Kind,
|
|
101
|
-
};
|
|
102
|
-
if (this.url) {
|
|
103
|
-
result.url = this.url;
|
|
104
|
-
}
|
|
105
|
-
if (this.name) {
|
|
106
|
-
result.name = this.name;
|
|
107
|
-
}
|
|
108
|
-
if (typeof this.useRequestUrl === 'boolean') {
|
|
109
|
-
result.useRequestUrl = this.useRequestUrl;
|
|
110
|
-
}
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
}
|