@api-client/core 0.9.4 → 0.9.6
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 +14 -3
- package/build/browser.js +16 -2
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +15 -4
- package/build/index.js +17 -3
- package/build/index.js.map +1 -1
- package/build/src/data/{JmesparthReader.d.ts → JmespathReader.d.ts} +1 -1
- package/build/src/data/{JmesparthReader.js → JmespathReader.js} +2 -2
- package/build/src/data/JmespathReader.js.map +1 -0
- package/build/src/data/RequestDataExtractor.d.ts +5 -5
- package/build/src/data/RequestDataExtractor.js.map +1 -1
- package/build/src/data/XmlReader.js +14 -1
- package/build/src/data/XmlReader.js.map +1 -1
- package/build/src/events/BaseEvents.d.ts +25 -0
- package/build/src/events/Events.d.ts +1 -1
- package/build/src/events/transport/TransportEvents.d.ts +1 -1
- package/build/src/events/transport/TransportEvents.js.map +1 -1
- package/build/src/models/ClientCertificate.d.ts +9 -0
- package/build/src/models/ClientCertificate.js.map +1 -1
- package/build/src/models/Environment.d.ts +3 -2
- package/build/src/models/Environment.js +11 -6
- package/build/src/models/Environment.js.map +1 -1
- package/build/src/models/ErrorResponse.js.map +1 -1
- package/build/src/models/HttpRequest.d.ts +2 -7
- package/build/src/models/HttpRequest.js +1 -6
- package/build/src/models/HttpRequest.js.map +1 -1
- package/build/src/models/HttpResponse.d.ts +2 -7
- package/build/src/models/HttpResponse.js +1 -3
- package/build/src/models/HttpResponse.js.map +1 -1
- package/build/src/models/ProjectExecution.d.ts +115 -0
- package/build/src/models/ProjectExecution.js +148 -0
- package/build/src/models/ProjectExecution.js.map +1 -0
- package/build/src/models/ProjectRequest.d.ts +19 -0
- package/build/src/models/ProjectRequest.js +50 -0
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/Request.d.ts +12 -3
- package/build/src/models/Request.js +14 -1
- package/build/src/models/Request.js.map +1 -1
- package/build/src/models/RequestAuthorization.js.map +1 -1
- package/build/src/models/RequestLog.d.ts +11 -0
- package/build/src/models/RequestLog.js +15 -1
- package/build/src/models/RequestLog.js.map +1 -1
- package/build/src/models/SerializablePayload.d.ts +6 -1
- package/build/src/models/SerializablePayload.js +10 -6
- package/build/src/models/SerializablePayload.js.map +1 -1
- package/build/src/models/http-actions/AssertionError.d.ts +36 -0
- package/build/src/models/http-actions/AssertionError.js +35 -0
- package/build/src/models/http-actions/AssertionError.js.map +1 -0
- package/build/src/models/http-actions/HttpAssertion.d.ts +84 -0
- package/build/src/models/http-actions/HttpAssertion.js +52 -0
- package/build/src/models/http-actions/HttpAssertion.js.map +1 -0
- package/build/src/models/http-actions/HttpFlows.d.ts +109 -0
- package/build/src/models/http-actions/HttpFlows.js +31 -0
- package/build/src/models/http-actions/HttpFlows.js.map +1 -0
- package/build/src/models/http-actions/HttpStep.d.ts +29 -0
- package/build/src/models/http-actions/HttpStep.js +30 -0
- package/build/src/models/http-actions/HttpStep.js.map +1 -0
- package/build/src/models/http-actions/LegacyTranslator.d.ts +8 -7
- package/build/src/models/http-actions/LegacyTranslator.js +18 -13
- package/build/src/models/http-actions/LegacyTranslator.js.map +1 -1
- package/build/src/models/http-actions/steps/assertion/EqualAssertion.d.ts +76 -0
- package/build/src/models/http-actions/steps/assertion/EqualAssertion.js +79 -0
- package/build/src/models/http-actions/steps/assertion/EqualAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/GreaterThanAssertion.d.ts +36 -0
- package/build/src/models/http-actions/steps/assertion/GreaterThanAssertion.js +59 -0
- package/build/src/models/http-actions/steps/assertion/GreaterThanAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/IncludesAssertion.d.ts +28 -0
- package/build/src/models/http-actions/steps/assertion/IncludesAssertion.js +45 -0
- package/build/src/models/http-actions/steps/assertion/IncludesAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/IsEmptyAssertion.d.ts +18 -0
- package/build/src/models/http-actions/steps/assertion/IsEmptyAssertion.js +29 -0
- package/build/src/models/http-actions/steps/assertion/IsEmptyAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/IsNotEmptyAssertion.d.ts +18 -0
- package/build/src/models/http-actions/steps/assertion/IsNotEmptyAssertion.js +29 -0
- package/build/src/models/http-actions/steps/assertion/IsNotEmptyAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/LengthOfAssertion.d.ts +28 -0
- package/build/src/models/http-actions/steps/assertion/LengthOfAssertion.js +45 -0
- package/build/src/models/http-actions/steps/assertion/LengthOfAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/LessThanAssertion.d.ts +36 -0
- package/build/src/models/http-actions/steps/assertion/LessThanAssertion.js +59 -0
- package/build/src/models/http-actions/steps/assertion/LessThanAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/MatchesAssertion.d.ts +28 -0
- package/build/src/models/http-actions/steps/assertion/MatchesAssertion.js +45 -0
- package/build/src/models/http-actions/steps/assertion/MatchesAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/MatchesSchemaAssertion.d.ts +36 -0
- package/build/src/models/http-actions/steps/assertion/MatchesSchemaAssertion.js +59 -0
- package/build/src/models/http-actions/steps/assertion/MatchesSchemaAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/NotEqualAssertion.d.ts +76 -0
- package/build/src/models/http-actions/steps/assertion/NotEqualAssertion.js +79 -0
- package/build/src/models/http-actions/steps/assertion/NotEqualAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/NotIncludesAssertion.d.ts +28 -0
- package/build/src/models/http-actions/steps/assertion/NotIncludesAssertion.js +45 -0
- package/build/src/models/http-actions/steps/assertion/NotIncludesAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/NotOkAssertion.d.ts +18 -0
- package/build/src/models/http-actions/steps/assertion/NotOkAssertion.js +29 -0
- package/build/src/models/http-actions/steps/assertion/NotOkAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/NotToBeAssertion.d.ts +29 -0
- package/build/src/models/http-actions/steps/assertion/NotToBeAssertion.js +45 -0
- package/build/src/models/http-actions/steps/assertion/NotToBeAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/OkAssertion.d.ts +18 -0
- package/build/src/models/http-actions/steps/assertion/OkAssertion.js +29 -0
- package/build/src/models/http-actions/steps/assertion/OkAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/ToBeAssertion.d.ts +35 -0
- package/build/src/models/http-actions/steps/assertion/ToBeAssertion.js +53 -0
- package/build/src/models/http-actions/steps/assertion/ToBeAssertion.js.map +1 -0
- package/build/src/models/http-actions/steps/assertion/index.d.ts +15 -0
- package/build/src/models/http-actions/steps/assertion/index.js +16 -0
- package/build/src/models/http-actions/steps/assertion/index.js.map +1 -0
- package/build/src/models/http-actions/steps/data/DeleteCookieStep.d.ts +44 -0
- package/build/src/models/http-actions/steps/data/DeleteCookieStep.js +67 -0
- package/build/src/models/http-actions/steps/data/DeleteCookieStep.js.map +1 -0
- package/build/src/models/http-actions/steps/data/ReadDataSourceStep.d.ts +53 -0
- package/build/src/models/http-actions/steps/data/ReadDataSourceStep.js +60 -0
- package/build/src/models/http-actions/steps/data/ReadDataSourceStep.js.map +1 -0
- package/build/src/models/http-actions/steps/data/ReadDataStep.d.ts +67 -0
- package/build/src/models/http-actions/steps/data/ReadDataStep.js +77 -0
- package/build/src/models/http-actions/steps/data/ReadDataStep.js.map +1 -0
- package/build/src/models/http-actions/steps/data/ReadValueStep.d.ts +45 -0
- package/build/src/models/http-actions/steps/data/ReadValueStep.js +52 -0
- package/build/src/models/http-actions/steps/data/ReadValueStep.js.map +1 -0
- package/build/src/models/http-actions/steps/data/SetCookieStep.d.ts +100 -0
- package/build/src/models/http-actions/steps/data/SetCookieStep.js +138 -0
- package/build/src/models/http-actions/steps/data/SetCookieStep.js.map +1 -0
- package/build/src/models/http-actions/steps/data/SetDataStep.d.ts +77 -0
- package/build/src/models/http-actions/steps/data/SetDataStep.js +69 -0
- package/build/src/models/http-actions/steps/data/SetDataStep.js.map +1 -0
- package/build/src/models/http-actions/steps/data/SetVariableStep.d.ts +40 -0
- package/build/src/models/http-actions/steps/data/SetVariableStep.js +44 -0
- package/build/src/models/http-actions/steps/data/SetVariableStep.js.map +1 -0
- package/build/src/models/http-actions/steps/data/index.d.ts +7 -0
- package/build/src/models/http-actions/steps/data/index.js +8 -0
- package/build/src/models/http-actions/steps/data/index.js.map +1 -0
- package/build/src/models/http-actions/steps/transformation/AsLowerCaseStep.d.ts +18 -0
- package/build/src/models/http-actions/steps/transformation/AsLowerCaseStep.js +29 -0
- package/build/src/models/http-actions/steps/transformation/AsLowerCaseStep.js.map +1 -0
- package/build/src/models/http-actions/steps/transformation/AsNumberStep.d.ts +18 -0
- package/build/src/models/http-actions/steps/transformation/AsNumberStep.js +29 -0
- package/build/src/models/http-actions/steps/transformation/AsNumberStep.js.map +1 -0
- package/build/src/models/http-actions/steps/transformation/AsUpperCaseStep.d.ts +18 -0
- package/build/src/models/http-actions/steps/transformation/AsUpperCaseStep.js +29 -0
- package/build/src/models/http-actions/steps/transformation/AsUpperCaseStep.js.map +1 -0
- package/build/src/models/http-actions/steps/transformation/RoundStep.d.ts +43 -0
- package/build/src/models/http-actions/steps/transformation/RoundStep.js +52 -0
- package/build/src/models/http-actions/steps/transformation/RoundStep.js.map +1 -0
- package/build/src/models/http-actions/steps/transformation/SubstringStep.d.ts +38 -0
- package/build/src/models/http-actions/steps/transformation/SubstringStep.js +65 -0
- package/build/src/models/http-actions/steps/transformation/SubstringStep.js.map +1 -0
- package/build/src/models/http-actions/steps/transformation/TrimStep.d.ts +20 -0
- package/build/src/models/http-actions/steps/transformation/TrimStep.js +30 -0
- package/build/src/models/http-actions/steps/transformation/TrimStep.js.map +1 -0
- package/build/src/models/http-actions/steps/transformation/index.d.ts +6 -0
- package/build/src/models/http-actions/steps/transformation/index.js +7 -0
- package/build/src/models/http-actions/steps/transformation/index.js.map +1 -0
- package/build/src/proxy/HttpProjectProxy.d.ts +1 -1
- package/build/src/proxy/Proxy.d.ts +1 -1
- package/build/src/proxy/ProxyService.d.ts +1 -1
- package/build/src/proxy/RequestProxy.d.ts +7 -2
- package/build/src/proxy/RequestProxy.js +4 -1
- package/build/src/proxy/RequestProxy.js.map +1 -1
- package/build/src/runtime/http-runner/ConditionCheck.d.ts +10 -10
- package/build/src/runtime/http-runner/ConditionCheck.js.map +1 -1
- package/build/src/runtime/http-runner/HttpAssertionRunner.d.ts +75 -0
- package/build/src/runtime/http-runner/HttpAssertionRunner.js +538 -0
- package/build/src/runtime/http-runner/HttpAssertionRunner.js.map +1 -0
- package/build/src/runtime/http-runner/HttpFlowRunner.d.ts +11 -6
- package/build/src/runtime/http-runner/HttpFlowRunner.js +24 -15
- package/build/src/runtime/http-runner/HttpFlowRunner.js.map +1 -1
- package/build/src/runtime/http-runner/HttpRequestRunner.d.ts +14 -3
- package/build/src/runtime/http-runner/HttpRequestRunner.js +44 -0
- package/build/src/runtime/http-runner/HttpRequestRunner.js.map +1 -1
- package/build/src/runtime/node/BaseRunner.d.ts +1 -1
- package/build/src/runtime/node/ProjectParallelRunner.d.ts +2 -2
- package/build/src/runtime/node/ProjectParallelRunner.js +2 -2
- package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRequestRunner.js +6 -2
- package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunner.d.ts +1 -1
- package/build/src/runtime/node/ProjectSerialRunner.d.ts +1 -1
- package/build/src/runtime/reporters/Reporter.d.ts +1 -33
- package/build/src/runtime/reporters/Reporter.js.map +1 -1
- package/build/src/runtime/store/interfaces/ApiClientStore.d.ts +2 -0
- package/build/src/runtime/store/interfaces/ProjectRuns.d.ts +56 -0
- package/build/src/runtime/store/interfaces/ProjectRuns.js +2 -0
- package/build/src/runtime/store/interfaces/ProjectRuns.js.map +1 -0
- package/package.json +3 -2
- package/src/data/{JmesparthReader.ts → JmespathReader.ts} +2 -2
- package/src/data/RequestDataExtractor.ts +5 -5
- package/src/data/XmlReader.ts +16 -2
- package/src/events/BaseEvents.ts +30 -0
- package/src/events/transport/TransportEvents.ts +1 -1
- package/src/models/ClientCertificate.ts +9 -0
- package/src/models/Environment.ts +11 -7
- package/src/models/ErrorResponse.ts +1 -1
- package/src/models/HttpRequest.ts +4 -14
- package/src/models/HttpResponse.ts +5 -11
- package/src/models/ProjectExecution.ts +227 -0
- package/src/models/ProjectRequest.ts +54 -0
- package/src/models/Request.ts +23 -4
- package/src/models/RequestAuthorization.ts +1 -1
- package/src/models/RequestLog.ts +21 -1
- package/src/models/SerializablePayload.ts +18 -1
- package/src/models/http-actions/AssertionError.ts +57 -0
- package/src/models/http-actions/HttpAssertion.ts +89 -0
- package/src/models/http-actions/HttpFlows.ts +115 -0
- package/src/models/http-actions/HttpStep.ts +50 -0
- package/src/models/http-actions/LegacyTranslator.ts +42 -30
- package/src/models/http-actions/steps/assertion/EqualAssertion.ts +130 -0
- package/src/models/http-actions/steps/assertion/GreaterThanAssertion.ts +87 -0
- package/src/models/http-actions/steps/assertion/IncludesAssertion.ts +68 -0
- package/src/models/http-actions/steps/assertion/IsEmptyAssertion.ts +41 -0
- package/src/models/http-actions/steps/assertion/IsNotEmptyAssertion.ts +41 -0
- package/src/models/http-actions/steps/assertion/LengthOfAssertion.ts +68 -0
- package/src/models/http-actions/steps/assertion/LessThanAssertion.ts +87 -0
- package/src/models/http-actions/steps/assertion/MatchesAssertion.ts +68 -0
- package/src/models/http-actions/steps/assertion/MatchesSchemaAssertion.ts +85 -0
- package/src/models/http-actions/steps/assertion/NotEqualAssertion.ts +130 -0
- package/src/models/http-actions/steps/assertion/NotIncludesAssertion.ts +68 -0
- package/src/models/http-actions/steps/assertion/NotOkAssertion.ts +41 -0
- package/src/models/http-actions/steps/assertion/NotToBeAssertion.ts +69 -0
- package/src/models/http-actions/steps/assertion/OkAssertion.ts +41 -0
- package/src/models/http-actions/steps/assertion/ToBeAssertion.ts +76 -0
- package/src/models/http-actions/steps/data/DeleteCookieStep.ts +102 -0
- package/src/models/http-actions/steps/data/ReadDataSourceStep.ts +103 -0
- package/src/models/http-actions/steps/data/ReadDataStep.ts +128 -0
- package/src/models/http-actions/steps/data/ReadValueStep.ts +88 -0
- package/src/models/http-actions/steps/data/SetCookieStep.ts +206 -0
- package/src/models/http-actions/steps/data/SetDataStep.ts +124 -0
- package/src/models/http-actions/steps/data/SetVariableStep.ts +82 -0
- package/src/models/http-actions/steps/transformation/AsLowerCaseStep.ts +41 -0
- package/src/models/http-actions/steps/transformation/AsNumberStep.ts +41 -0
- package/src/models/http-actions/steps/transformation/AsUpperCaseStep.ts +41 -0
- package/src/models/http-actions/steps/transformation/RoundStep.ts +86 -0
- package/src/models/http-actions/steps/transformation/SubstringStep.ts +93 -0
- package/src/models/http-actions/steps/transformation/TrimStep.ts +43 -0
- package/src/proxy/HttpProjectProxy.ts +1 -1
- package/src/proxy/Proxy.ts +1 -1
- package/src/proxy/ProxyService.ts +1 -1
- package/src/proxy/RequestProxy.ts +11 -3
- package/src/runtime/http-runner/ConditionCheck.ts +13 -14
- package/src/runtime/http-runner/HttpAssertionRunner.ts +540 -0
- package/src/runtime/http-runner/HttpFlowRunner.ts +33 -19
- package/src/runtime/http-runner/HttpRequestRunner.ts +53 -5
- package/src/runtime/node/BaseRunner.ts +1 -1
- package/src/runtime/node/ProjectParallelRunner.ts +5 -5
- package/src/runtime/node/ProjectRequestRunner.ts +6 -2
- package/src/runtime/node/ProjectRunner.ts +1 -1
- package/src/runtime/node/ProjectRunnerWorker.ts +1 -1
- package/src/runtime/node/ProjectSerialRunner.ts +1 -1
- package/src/runtime/reporters/Reporter.ts +1 -35
- package/src/runtime/store/interfaces/ApiClientStore.ts +3 -0
- package/src/runtime/store/interfaces/ProjectRuns.ts +64 -0
- package/build/src/data/JmesparthReader.js.map +0 -1
- package/build/src/models/http-actions/HttpActions.d.ts +0 -256
- package/build/src/models/http-actions/HttpActions.js +0 -46
- package/build/src/models/http-actions/HttpActions.js.map +0 -1
- package/src/models/http-actions/HttpActions.ts +0 -270
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { FlowRequestDataEnum, FlowResponseDataEnum, FlowSourceEnum } from "../../HttpFlows.js";
|
|
2
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
3
|
+
|
|
4
|
+
export const ReadDataStepKind = 'HttpAction#ReadData';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reads the data from various sources.
|
|
8
|
+
*/
|
|
9
|
+
export interface IReadDataStep extends IHttpStep {
|
|
10
|
+
kind: typeof ReadDataStepKind;
|
|
11
|
+
/**
|
|
12
|
+
* The main data source.
|
|
13
|
+
* In the legacy actions this was `type`.
|
|
14
|
+
*/
|
|
15
|
+
source?: FlowSourceEnum;
|
|
16
|
+
/**
|
|
17
|
+
* Source of the data.
|
|
18
|
+
* In the legacy actions this was `source`.
|
|
19
|
+
* This is not required when the source is not `request` or `response`.
|
|
20
|
+
*/
|
|
21
|
+
data?: FlowRequestDataEnum | FlowResponseDataEnum;
|
|
22
|
+
/**
|
|
23
|
+
* The path to the data.
|
|
24
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
25
|
+
* For XML use xpath.
|
|
26
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
27
|
+
*/
|
|
28
|
+
path?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class ReadDataStep extends HttpStep {
|
|
32
|
+
override kind = ReadDataStepKind;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The main data source.
|
|
36
|
+
* In the legacy actions this was `type`.
|
|
37
|
+
*/
|
|
38
|
+
source?: FlowSourceEnum;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Source of the data.
|
|
42
|
+
* In the legacy actions this was `source`.
|
|
43
|
+
* This is not required when the source is not `request` or `response`.
|
|
44
|
+
*/
|
|
45
|
+
data?: FlowRequestDataEnum | FlowResponseDataEnum;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The path to the data.
|
|
49
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
50
|
+
* For XML use xpath.
|
|
51
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
52
|
+
*/
|
|
53
|
+
path?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Creates the step from values.
|
|
57
|
+
* @param source The main data source.
|
|
58
|
+
* @param path The path to the data.
|
|
59
|
+
* @param data Source of the data in the `source`. This is optional for non-http-request source.
|
|
60
|
+
*/
|
|
61
|
+
constructor(source: FlowSourceEnum, path?: string, data?: FlowRequestDataEnum | FlowResponseDataEnum);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Creates the step from serialized schema.
|
|
65
|
+
* @param init The serialized step values.
|
|
66
|
+
*/
|
|
67
|
+
constructor(init: IReadDataStep);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Creates an empty step.
|
|
71
|
+
*/
|
|
72
|
+
constructor();
|
|
73
|
+
|
|
74
|
+
constructor(sourceOrInit?: FlowSourceEnum | IReadDataStep, path?: string, data?: FlowRequestDataEnum | FlowResponseDataEnum) {
|
|
75
|
+
super();
|
|
76
|
+
if (!sourceOrInit) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (typeof sourceOrInit === 'object') {
|
|
80
|
+
const typed = sourceOrInit as IReadDataStep;
|
|
81
|
+
this.new(typed);
|
|
82
|
+
} else if (typeof sourceOrInit === 'string') {
|
|
83
|
+
this.new({
|
|
84
|
+
kind: ReadDataStepKind,
|
|
85
|
+
source: sourceOrInit,
|
|
86
|
+
data,
|
|
87
|
+
path,
|
|
88
|
+
enabled: true,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
override new(init: IReadDataStep): void {
|
|
94
|
+
super.new(init);
|
|
95
|
+
this.kind = ReadDataStepKind;
|
|
96
|
+
this.source = init.source;
|
|
97
|
+
this.data = init.data;
|
|
98
|
+
this.path = init.path;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
checkValidity(): boolean {
|
|
102
|
+
const { source, path, data } = this;
|
|
103
|
+
if (!source && !path) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (source === FlowSourceEnum.variable) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
return !!data;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
override toJSON(): IReadDataStep {
|
|
113
|
+
const result: IReadDataStep = {
|
|
114
|
+
...super.toJSON(),
|
|
115
|
+
kind: ReadDataStepKind,
|
|
116
|
+
};
|
|
117
|
+
if (this.source) {
|
|
118
|
+
result.source = this.source;
|
|
119
|
+
}
|
|
120
|
+
if (this.data) {
|
|
121
|
+
result.data = this.data;
|
|
122
|
+
}
|
|
123
|
+
if (this.path) {
|
|
124
|
+
result.path = this.path;
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
|
|
3
|
+
export const ReadValueStepKind = 'HttpAction#ReadValue';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Reads the value for a given path from the input data. This works with the `ReadDataSourceStep`.
|
|
7
|
+
*/
|
|
8
|
+
export interface IReadValueStep extends IHttpStep {
|
|
9
|
+
kind: typeof ReadValueStepKind;
|
|
10
|
+
/**
|
|
11
|
+
* The path to the data.
|
|
12
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
13
|
+
* For XML use xpath.
|
|
14
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
15
|
+
*/
|
|
16
|
+
path?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Reads the value for a given path from the input data. This works with the `ReadDataSourceStep`.
|
|
21
|
+
*/
|
|
22
|
+
export class ReadValueStep extends HttpStep {
|
|
23
|
+
override kind = ReadValueStepKind;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The path to the data.
|
|
27
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
28
|
+
* For XML use xpath.
|
|
29
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
30
|
+
*/
|
|
31
|
+
path?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Creates the step from values.
|
|
35
|
+
* @param path The path to the data.
|
|
36
|
+
*/
|
|
37
|
+
constructor(path: string);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Creates the step from serialized schema.
|
|
41
|
+
* @param init The serialized step values.
|
|
42
|
+
*/
|
|
43
|
+
constructor(init: IReadValueStep);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Creates an empty step.
|
|
47
|
+
*/
|
|
48
|
+
constructor();
|
|
49
|
+
|
|
50
|
+
constructor(pathOrInit?: string | IReadValueStep) {
|
|
51
|
+
super();
|
|
52
|
+
if (!pathOrInit) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (typeof pathOrInit === 'object') {
|
|
56
|
+
const typed = pathOrInit as IReadValueStep;
|
|
57
|
+
this.new(typed);
|
|
58
|
+
} else if (typeof pathOrInit === 'string') {
|
|
59
|
+
this.new({
|
|
60
|
+
kind: ReadValueStepKind,
|
|
61
|
+
path: pathOrInit,
|
|
62
|
+
enabled: true,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
override new(init: IReadValueStep): void {
|
|
68
|
+
super.new(init);
|
|
69
|
+
this.kind = ReadValueStepKind;
|
|
70
|
+
this.path = init.path;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
checkValidity(): boolean {
|
|
74
|
+
const { path } = this;
|
|
75
|
+
return !!path;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
override toJSON(): IReadValueStep {
|
|
79
|
+
const result: IReadValueStep = {
|
|
80
|
+
...super.toJSON(),
|
|
81
|
+
kind: ReadValueStepKind,
|
|
82
|
+
};
|
|
83
|
+
if (this.path) {
|
|
84
|
+
result.path = this.path;
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { SameSiteValue } from "../../../../cookies/CookieParser.js";
|
|
2
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
3
|
+
|
|
4
|
+
export const SetCookieStepKind = 'HttpAction#SetCookie';
|
|
5
|
+
|
|
6
|
+
export interface ISetCookieStepInit {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the cookie
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* The URL associated with the cookie. When not set it uses the request URL or the request URL of the last redirect.
|
|
13
|
+
*/
|
|
14
|
+
url?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The cookie expiration time. It can be a valid cookie date or a string representing a relative time to "now"
|
|
17
|
+
* like `4d`, `600s`, etc.
|
|
18
|
+
*/
|
|
19
|
+
expires?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the cookie is host only
|
|
22
|
+
*/
|
|
23
|
+
hostOnly?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the cookie is HTTP only
|
|
26
|
+
*/
|
|
27
|
+
httpOnly?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the cookie is HTTPS only
|
|
30
|
+
*/
|
|
31
|
+
secure?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the cookie is a session cookie
|
|
34
|
+
*/
|
|
35
|
+
session?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The SameSite parameter of the cookie.
|
|
38
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#creating_cookies
|
|
39
|
+
*/
|
|
40
|
+
sameSite?: SameSiteValue;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A step that allows to set a cookie with the value returned by a previous step.
|
|
45
|
+
*/
|
|
46
|
+
export interface ISetCookieStep extends IHttpStep, ISetCookieStepInit {
|
|
47
|
+
kind: typeof SetCookieStepKind;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
export class SetCookieStep extends HttpStep {
|
|
52
|
+
override kind = SetCookieStepKind;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The name of the cookie
|
|
56
|
+
*/
|
|
57
|
+
name = '';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The URL associated with the cookie.
|
|
61
|
+
* When not set it uses the request URL or the request URL of the last redirect.
|
|
62
|
+
*/
|
|
63
|
+
url?: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The cookie expiration time. It can be a valid cookie date or a string representing a relative time to "now"
|
|
67
|
+
* like `4d`, `600s`, etc.
|
|
68
|
+
*/
|
|
69
|
+
expires?: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Whether the cookie is host only
|
|
73
|
+
*/
|
|
74
|
+
hostOnly?: boolean;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether the cookie is HTTP only
|
|
78
|
+
*/
|
|
79
|
+
httpOnly?: boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Whether the cookie is HTTPS only
|
|
83
|
+
*/
|
|
84
|
+
secure?: boolean;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Whether the cookie is a session cookie
|
|
88
|
+
*/
|
|
89
|
+
session?: boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The SameSite parameter of the cookie.
|
|
93
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#creating_cookies
|
|
94
|
+
*/
|
|
95
|
+
sameSite?: SameSiteValue;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Creates the step from values.
|
|
99
|
+
* @param name The name of the variable to set
|
|
100
|
+
*/
|
|
101
|
+
constructor(name: string);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Creates the step from serialized schema.
|
|
105
|
+
* @param init The serialized step values.
|
|
106
|
+
*/
|
|
107
|
+
constructor(init: ISetCookieStepInit);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Creates an empty step.
|
|
111
|
+
*/
|
|
112
|
+
constructor();
|
|
113
|
+
|
|
114
|
+
constructor(nameOrInit?: string | ISetCookieStepInit) {
|
|
115
|
+
super();
|
|
116
|
+
if (!nameOrInit) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (typeof nameOrInit === 'object') {
|
|
120
|
+
const typed = nameOrInit as ISetCookieStepInit;
|
|
121
|
+
this.new({ ...typed, kind: SetCookieStepKind });
|
|
122
|
+
} else if (typeof nameOrInit === 'string') {
|
|
123
|
+
this.new({
|
|
124
|
+
kind: SetCookieStepKind,
|
|
125
|
+
name: nameOrInit,
|
|
126
|
+
enabled: true,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
override new(init: ISetCookieStep): void {
|
|
132
|
+
super.new(init);
|
|
133
|
+
this.kind = SetCookieStepKind;
|
|
134
|
+
this.name = init.name;
|
|
135
|
+
if (init.url) {
|
|
136
|
+
this.url = init.url;
|
|
137
|
+
} else {
|
|
138
|
+
this.url = undefined;
|
|
139
|
+
}
|
|
140
|
+
if (init.expires) {
|
|
141
|
+
this.expires = init.expires;
|
|
142
|
+
} else {
|
|
143
|
+
this.expires = undefined;
|
|
144
|
+
}
|
|
145
|
+
if (typeof init.hostOnly === 'boolean') {
|
|
146
|
+
this.hostOnly = init.hostOnly;
|
|
147
|
+
} else {
|
|
148
|
+
this.hostOnly = undefined;
|
|
149
|
+
}
|
|
150
|
+
if (typeof init.httpOnly === 'boolean') {
|
|
151
|
+
this.httpOnly = init.httpOnly;
|
|
152
|
+
} else {
|
|
153
|
+
this.httpOnly = undefined;
|
|
154
|
+
}
|
|
155
|
+
if (typeof init.secure === 'boolean') {
|
|
156
|
+
this.secure = init.secure;
|
|
157
|
+
} else {
|
|
158
|
+
this.secure = undefined;
|
|
159
|
+
}
|
|
160
|
+
if (typeof init.session === 'boolean') {
|
|
161
|
+
this.session = init.session;
|
|
162
|
+
} else {
|
|
163
|
+
this.session = undefined;
|
|
164
|
+
}
|
|
165
|
+
if (typeof init.sameSite === 'boolean') {
|
|
166
|
+
this.sameSite = init.sameSite;
|
|
167
|
+
} else {
|
|
168
|
+
this.sameSite = undefined;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
checkValidity(): boolean {
|
|
173
|
+
const { name } = this;
|
|
174
|
+
return !!name;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
override toJSON(): ISetCookieStep {
|
|
178
|
+
const result: ISetCookieStep = {
|
|
179
|
+
...super.toJSON(),
|
|
180
|
+
kind: SetCookieStepKind,
|
|
181
|
+
name: this.name,
|
|
182
|
+
};
|
|
183
|
+
if (this.url) {
|
|
184
|
+
result.url = this.url;
|
|
185
|
+
}
|
|
186
|
+
if (this.expires) {
|
|
187
|
+
result.expires = this.expires;
|
|
188
|
+
}
|
|
189
|
+
if (typeof this.hostOnly === 'boolean') {
|
|
190
|
+
result.hostOnly = this.hostOnly;
|
|
191
|
+
}
|
|
192
|
+
if (typeof this.httpOnly === 'boolean') {
|
|
193
|
+
result.httpOnly = this.httpOnly;
|
|
194
|
+
}
|
|
195
|
+
if (typeof this.secure === 'boolean') {
|
|
196
|
+
result.secure = this.secure;
|
|
197
|
+
}
|
|
198
|
+
if (typeof this.session === 'boolean') {
|
|
199
|
+
result.session = this.session;
|
|
200
|
+
}
|
|
201
|
+
if (typeof this.sameSite === 'boolean') {
|
|
202
|
+
result.sameSite = this.sameSite;
|
|
203
|
+
}
|
|
204
|
+
return result;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
|
|
3
|
+
export const SetDataStepKind = 'HttpAction#SetData';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Sets a manually defined value that can be passed to the next step.
|
|
7
|
+
*/
|
|
8
|
+
export interface ISetDataStep extends IHttpStep {
|
|
9
|
+
kind: typeof SetDataStepKind;
|
|
10
|
+
/**
|
|
11
|
+
* The value to return to the next step.
|
|
12
|
+
* This is always a string. Use the `dataType` to determine the correct data type.
|
|
13
|
+
*/
|
|
14
|
+
value: string;
|
|
15
|
+
/**
|
|
16
|
+
* The data type of the value. This is a value prefixed with
|
|
17
|
+
* `http://www.w3.org/2001/XMLSchema#` or `http://a.ml/vocabularies/shapes#`.
|
|
18
|
+
*
|
|
19
|
+
* Examples:
|
|
20
|
+
*
|
|
21
|
+
* - `http://www.w3.org/2001/XMLSchema#boolean`
|
|
22
|
+
* - `http://www.w3.org/2001/XMLSchema#string`
|
|
23
|
+
* - `http://www.w3.org/2001/XMLSchema#number`
|
|
24
|
+
* - `http://www.w3.org/2001/XMLSchema#integer`
|
|
25
|
+
* - `http://www.w3.org/2001/XMLSchema#long`
|
|
26
|
+
* - `http://a.ml/vocabularies/shapes#number`
|
|
27
|
+
* - `http://a.ml/vocabularies/shapes#integer`
|
|
28
|
+
* - `http://a.ml/vocabularies/shapes#double`
|
|
29
|
+
* - ...
|
|
30
|
+
*
|
|
31
|
+
* @default `http://www.w3.org/2001/XMLSchema#string`
|
|
32
|
+
*/
|
|
33
|
+
dataType?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class SetDataStep extends HttpStep {
|
|
37
|
+
override kind = SetDataStepKind;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The value to return to the next step.
|
|
41
|
+
* This is always a string. Use the `dataType` to determine the correct data type.
|
|
42
|
+
*/
|
|
43
|
+
value = '';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The data type of the value. This is a value prefixed with
|
|
47
|
+
* `http://www.w3.org/2001/XMLSchema#` or `http://a.ml/vocabularies/shapes#`.
|
|
48
|
+
*
|
|
49
|
+
* Examples:
|
|
50
|
+
*
|
|
51
|
+
* - `http://www.w3.org/2001/XMLSchema#boolean`
|
|
52
|
+
* - `http://www.w3.org/2001/XMLSchema#string`
|
|
53
|
+
* - `http://www.w3.org/2001/XMLSchema#number`
|
|
54
|
+
* - `http://www.w3.org/2001/XMLSchema#integer`
|
|
55
|
+
* - `http://www.w3.org/2001/XMLSchema#long`
|
|
56
|
+
* - `http://a.ml/vocabularies/shapes#number`
|
|
57
|
+
* - `http://a.ml/vocabularies/shapes#integer`
|
|
58
|
+
* - `http://a.ml/vocabularies/shapes#double`
|
|
59
|
+
* - ...
|
|
60
|
+
*
|
|
61
|
+
* @default `http://www.w3.org/2001/XMLSchema#string`
|
|
62
|
+
*/
|
|
63
|
+
dataType?: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Creates the step from values.
|
|
67
|
+
* @param value The value this step sets.
|
|
68
|
+
* @param dataType The data type to use to read the value.
|
|
69
|
+
*/
|
|
70
|
+
constructor(value: string, dataType?: string);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Creates the step from serialized schema.
|
|
74
|
+
* @param init The serialized step values.
|
|
75
|
+
*/
|
|
76
|
+
constructor(init: ISetDataStep);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Creates an empty step.
|
|
80
|
+
*/
|
|
81
|
+
constructor();
|
|
82
|
+
|
|
83
|
+
constructor(valueOrInit?: string | ISetDataStep, dataType?: string) {
|
|
84
|
+
super();
|
|
85
|
+
if (!valueOrInit) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (typeof valueOrInit === 'object') {
|
|
89
|
+
const typed = valueOrInit as ISetDataStep;
|
|
90
|
+
this.new(typed);
|
|
91
|
+
} else if (typeof valueOrInit === 'string') {
|
|
92
|
+
this.new({
|
|
93
|
+
kind: SetDataStepKind,
|
|
94
|
+
value: valueOrInit,
|
|
95
|
+
dataType,
|
|
96
|
+
enabled: true,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
override new(init: ISetDataStep): void {
|
|
102
|
+
super.new(init);
|
|
103
|
+
this.kind = SetDataStepKind;
|
|
104
|
+
this.value = init.value;
|
|
105
|
+
this.dataType = init.dataType;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
checkValidity(): boolean {
|
|
109
|
+
const { value } = this;
|
|
110
|
+
return !!value;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
override toJSON(): ISetDataStep {
|
|
114
|
+
const result: ISetDataStep = {
|
|
115
|
+
...super.toJSON(),
|
|
116
|
+
kind: SetDataStepKind,
|
|
117
|
+
value: this.value,
|
|
118
|
+
};
|
|
119
|
+
if (this.dataType) {
|
|
120
|
+
result.dataType = this.dataType;
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
|
|
3
|
+
export const SetVariableStepKind = 'HttpAction#SetVariable';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A step that accepts an input from the previous step and sets a variable in the current environment
|
|
7
|
+
* with this value. If the value is `void`, `null`, or `undefined` then the variable is removed from the
|
|
8
|
+
* environment.
|
|
9
|
+
*
|
|
10
|
+
* All variables are strings.
|
|
11
|
+
*/
|
|
12
|
+
export interface ISetVariableStep extends IHttpStep {
|
|
13
|
+
kind: typeof SetVariableStepKind;
|
|
14
|
+
/**
|
|
15
|
+
* The name of the variable to set
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export class SetVariableStep extends HttpStep {
|
|
22
|
+
override kind = SetVariableStepKind;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The name of the variable to set
|
|
26
|
+
*/
|
|
27
|
+
name = '';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Creates the step from values.
|
|
31
|
+
* @param name The name of the variable to set
|
|
32
|
+
*/
|
|
33
|
+
constructor(name: string);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Creates the step from serialized schema.
|
|
37
|
+
* @param init The serialized step values.
|
|
38
|
+
*/
|
|
39
|
+
constructor(init: ISetVariableStep);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Creates an empty step.
|
|
43
|
+
*/
|
|
44
|
+
constructor();
|
|
45
|
+
|
|
46
|
+
constructor(nameOrInit?: string | ISetVariableStep) {
|
|
47
|
+
super();
|
|
48
|
+
if (!nameOrInit) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (typeof nameOrInit === 'object') {
|
|
52
|
+
const typed = nameOrInit as ISetVariableStep;
|
|
53
|
+
this.new(typed);
|
|
54
|
+
} else if (typeof nameOrInit === 'string') {
|
|
55
|
+
this.new({
|
|
56
|
+
kind: SetVariableStepKind,
|
|
57
|
+
name: nameOrInit,
|
|
58
|
+
enabled: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
override new(init: ISetVariableStep): void {
|
|
64
|
+
super.new(init);
|
|
65
|
+
this.kind = SetVariableStepKind;
|
|
66
|
+
this.name = init.name;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
checkValidity(): boolean {
|
|
70
|
+
const { name } = this;
|
|
71
|
+
return !!name;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
override toJSON(): ISetVariableStep {
|
|
75
|
+
const result: ISetVariableStep = {
|
|
76
|
+
...super.toJSON(),
|
|
77
|
+
kind: SetVariableStepKind,
|
|
78
|
+
name: this.name,
|
|
79
|
+
};
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
|
|
3
|
+
export const AsLowerCaseStepKind = 'HttpAction#AsLowerCase';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Reads the input and returns a lower case value of it.
|
|
7
|
+
*/
|
|
8
|
+
export interface IAsLowerCaseStep extends IHttpStep {
|
|
9
|
+
kind: typeof AsLowerCaseStepKind;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Reads the input and returns a lower case value of it.
|
|
14
|
+
*/
|
|
15
|
+
export class AsLowerCaseStep extends HttpStep {
|
|
16
|
+
override kind = AsLowerCaseStepKind;
|
|
17
|
+
|
|
18
|
+
constructor(init?: IAsLowerCaseStep) {
|
|
19
|
+
super();
|
|
20
|
+
if (typeof init === 'object') {
|
|
21
|
+
this.new(init);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override new(init: IAsLowerCaseStep): void {
|
|
26
|
+
super.new(init);
|
|
27
|
+
this.kind = AsLowerCaseStepKind;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
checkValidity(): boolean {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override toJSON(): IAsLowerCaseStep {
|
|
35
|
+
const result: IAsLowerCaseStep = {
|
|
36
|
+
...super.toJSON(),
|
|
37
|
+
kind: AsLowerCaseStepKind,
|
|
38
|
+
};
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
|
|
3
|
+
export const AsNumberStepKind = 'HttpAction#AsNumber';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Reads the input and returns is as a number.
|
|
7
|
+
*/
|
|
8
|
+
export interface IAsNumberStep extends IHttpStep {
|
|
9
|
+
kind: typeof AsNumberStepKind;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Reads the input and returns is as a number.
|
|
14
|
+
*/
|
|
15
|
+
export class AsNumberStep extends HttpStep {
|
|
16
|
+
override kind = AsNumberStepKind;
|
|
17
|
+
|
|
18
|
+
constructor(init?: IAsNumberStep) {
|
|
19
|
+
super();
|
|
20
|
+
if (typeof init === 'object') {
|
|
21
|
+
this.new(init);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override new(init: IAsNumberStep): void {
|
|
26
|
+
super.new(init);
|
|
27
|
+
this.kind = AsNumberStepKind;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
checkValidity(): boolean {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override toJSON(): IAsNumberStep {
|
|
35
|
+
const result: IAsNumberStep = {
|
|
36
|
+
...super.toJSON(),
|
|
37
|
+
kind: AsNumberStepKind,
|
|
38
|
+
};
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
}
|