@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,18 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
export declare const OkAssertionKind = "HttpAction#OkAssertion";
|
|
3
|
+
/**
|
|
4
|
+
* An assertion that makes sure the input has a truly value.
|
|
5
|
+
*/
|
|
6
|
+
export interface IOkAssertion extends IHttpStep {
|
|
7
|
+
kind: typeof OkAssertionKind;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* An assertion that makes sure the input has a truly value.
|
|
11
|
+
*/
|
|
12
|
+
export declare class OkAssertion extends HttpStep {
|
|
13
|
+
kind: string;
|
|
14
|
+
constructor(init?: IOkAssertion);
|
|
15
|
+
new(init: IOkAssertion): void;
|
|
16
|
+
checkValidity(): boolean;
|
|
17
|
+
toJSON(): IOkAssertion;
|
|
18
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HttpStep } from "../../HttpStep.js";
|
|
2
|
+
export const OkAssertionKind = 'HttpAction#OkAssertion';
|
|
3
|
+
/**
|
|
4
|
+
* An assertion that makes sure the input has a truly value.
|
|
5
|
+
*/
|
|
6
|
+
export class OkAssertion extends HttpStep {
|
|
7
|
+
kind = OkAssertionKind;
|
|
8
|
+
constructor(init) {
|
|
9
|
+
super();
|
|
10
|
+
if (typeof init === 'object') {
|
|
11
|
+
this.new(init);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
new(init) {
|
|
15
|
+
super.new(init);
|
|
16
|
+
this.kind = OkAssertionKind;
|
|
17
|
+
}
|
|
18
|
+
checkValidity() {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
toJSON() {
|
|
22
|
+
const result = {
|
|
23
|
+
...super.toJSON(),
|
|
24
|
+
kind: OkAssertionKind,
|
|
25
|
+
};
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=OkAssertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OkAssertion.js","sourceRoot":"","sources":["../../../../../../src/models/http-actions/steps/assertion/OkAssertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AASxD;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,QAAQ;IAC9B,IAAI,GAAG,eAAe,CAAC;IAEhC,YAAY,IAAmB;QAC7B,KAAK,EAAE,CAAC;QACR,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAChB;IACH,CAAC;IAEQ,GAAG,CAAC,IAAkB;QAC7B,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,MAAM;QACb,MAAM,MAAM,GAAiB;YAC3B,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,IAAI,EAAE,eAAe;SACtB,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
export declare const ToBeAssertionKind = "HttpAction#ToBeAssertion";
|
|
3
|
+
export declare enum ToBeTypes {
|
|
4
|
+
string = "string",
|
|
5
|
+
number = "number",
|
|
6
|
+
boolean = "boolean",
|
|
7
|
+
object = "object",
|
|
8
|
+
array = "array"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* An assertion that makes sure the input is of a specific type (string, number, boolean, object, array).
|
|
12
|
+
*/
|
|
13
|
+
export interface IToBeAssertion extends IHttpStep {
|
|
14
|
+
kind: typeof ToBeAssertionKind;
|
|
15
|
+
/**
|
|
16
|
+
* The type to expect.
|
|
17
|
+
*/
|
|
18
|
+
value?: ToBeTypes;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* An assertion that makes sure the input is of a specific type (string, number, boolean, object, array).
|
|
22
|
+
*/
|
|
23
|
+
export declare class ToBeAssertion extends HttpStep {
|
|
24
|
+
kind: string;
|
|
25
|
+
/**
|
|
26
|
+
* The type to expect.
|
|
27
|
+
*/
|
|
28
|
+
value?: ToBeTypes;
|
|
29
|
+
constructor(value: ToBeTypes);
|
|
30
|
+
constructor(init: IToBeAssertion);
|
|
31
|
+
constructor();
|
|
32
|
+
new(init: IToBeAssertion): void;
|
|
33
|
+
checkValidity(): boolean;
|
|
34
|
+
toJSON(): IToBeAssertion;
|
|
35
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { HttpStep } from "../../HttpStep.js";
|
|
2
|
+
export const ToBeAssertionKind = 'HttpAction#ToBeAssertion';
|
|
3
|
+
export var ToBeTypes;
|
|
4
|
+
(function (ToBeTypes) {
|
|
5
|
+
ToBeTypes["string"] = "string";
|
|
6
|
+
ToBeTypes["number"] = "number";
|
|
7
|
+
ToBeTypes["boolean"] = "boolean";
|
|
8
|
+
ToBeTypes["object"] = "object";
|
|
9
|
+
ToBeTypes["array"] = "array";
|
|
10
|
+
})(ToBeTypes || (ToBeTypes = {}));
|
|
11
|
+
/**
|
|
12
|
+
* An assertion that makes sure the input is of a specific type (string, number, boolean, object, array).
|
|
13
|
+
*/
|
|
14
|
+
export class ToBeAssertion extends HttpStep {
|
|
15
|
+
kind = ToBeAssertionKind;
|
|
16
|
+
/**
|
|
17
|
+
* The type to expect.
|
|
18
|
+
*/
|
|
19
|
+
value;
|
|
20
|
+
constructor(valueOrInit) {
|
|
21
|
+
super();
|
|
22
|
+
if (typeof valueOrInit === 'object') {
|
|
23
|
+
const typed = valueOrInit;
|
|
24
|
+
this.new(typed);
|
|
25
|
+
}
|
|
26
|
+
else if (typeof valueOrInit === 'string') {
|
|
27
|
+
this.new({
|
|
28
|
+
kind: ToBeAssertionKind,
|
|
29
|
+
value: valueOrInit,
|
|
30
|
+
enabled: true,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
new(init) {
|
|
35
|
+
super.new(init);
|
|
36
|
+
this.kind = ToBeAssertionKind;
|
|
37
|
+
this.value = init.value;
|
|
38
|
+
}
|
|
39
|
+
checkValidity() {
|
|
40
|
+
return !!this.value;
|
|
41
|
+
}
|
|
42
|
+
toJSON() {
|
|
43
|
+
const result = {
|
|
44
|
+
...super.toJSON(),
|
|
45
|
+
kind: ToBeAssertionKind,
|
|
46
|
+
};
|
|
47
|
+
if (this.value) {
|
|
48
|
+
result.value = this.value;
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=ToBeAssertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToBeAssertion.js","sourceRoot":"","sources":["../../../../../../src/models/http-actions/steps/assertion/ToBeAssertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAE5D,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,4BAAe,CAAA;AACjB,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AAcD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,QAAQ;IAChC,IAAI,GAAG,iBAAiB,CAAC;IAElC;;OAEG;IACH,KAAK,CAAa;IAQlB,YAAY,WAAwC;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACnC,MAAM,KAAK,GAAG,WAA6B,CAAC;YAC5C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACjB;aAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YAC1C,IAAI,CAAC,GAAG,CAAC;gBACP,IAAI,EAAE,iBAAiB;gBACvB,KAAK,EAAE,WAAW;gBAClB,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;SACJ;IACH,CAAC;IAEQ,GAAG,CAAC,IAAoB;QAC/B,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,aAAa;QACX,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAEQ,MAAM;QACb,MAAM,MAAM,GAAmB;YAC7B,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,IAAI,EAAE,iBAAiB;SACxB,CAAC;QACF,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;SAC3B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './EqualAssertion.js';
|
|
2
|
+
export * from './GreaterThanAssertion.js';
|
|
3
|
+
export * from './IncludesAssertion.js';
|
|
4
|
+
export * from './IsEmptyAssertion.js';
|
|
5
|
+
export * from './IsNotEmptyAssertion.js';
|
|
6
|
+
export * from './LengthOfAssertion.js';
|
|
7
|
+
export * from './LessThanAssertion.js';
|
|
8
|
+
export * from './MatchesAssertion.js';
|
|
9
|
+
export * from './MatchesSchemaAssertion.js';
|
|
10
|
+
export * from './NotEqualAssertion.js';
|
|
11
|
+
export * from './NotIncludesAssertion.js';
|
|
12
|
+
export * from './NotOkAssertion.js';
|
|
13
|
+
export * from './NotToBeAssertion.js';
|
|
14
|
+
export * from './OkAssertion.js';
|
|
15
|
+
export * from './ToBeAssertion.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './EqualAssertion.js';
|
|
2
|
+
export * from './GreaterThanAssertion.js';
|
|
3
|
+
export * from './IncludesAssertion.js';
|
|
4
|
+
export * from './IsEmptyAssertion.js';
|
|
5
|
+
export * from './IsNotEmptyAssertion.js';
|
|
6
|
+
export * from './LengthOfAssertion.js';
|
|
7
|
+
export * from './LessThanAssertion.js';
|
|
8
|
+
export * from './MatchesAssertion.js';
|
|
9
|
+
export * from './MatchesSchemaAssertion.js';
|
|
10
|
+
export * from './NotEqualAssertion.js';
|
|
11
|
+
export * from './NotIncludesAssertion.js';
|
|
12
|
+
export * from './NotOkAssertion.js';
|
|
13
|
+
export * from './NotToBeAssertion.js';
|
|
14
|
+
export * from './OkAssertion.js';
|
|
15
|
+
export * from './ToBeAssertion.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/models/http-actions/steps/assertion/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
export declare const DeleteCookieStepKind = "HttpAction#DeleteCookie";
|
|
3
|
+
/**
|
|
4
|
+
* A step allowing to delete a cookie for the given configuration.
|
|
5
|
+
* This step does not require an input.
|
|
6
|
+
*/
|
|
7
|
+
export interface IDeleteCookieStep extends IHttpStep {
|
|
8
|
+
kind: typeof DeleteCookieStepKind;
|
|
9
|
+
/**
|
|
10
|
+
* The URL associated with the cookie. When not set it uses the request URL or the request URL of the last redirect.
|
|
11
|
+
*/
|
|
12
|
+
url?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name of the cookie to remove.
|
|
15
|
+
* When not set it removes all cookies for the URL.
|
|
16
|
+
*/
|
|
17
|
+
name?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class DeleteCookieStep extends HttpStep {
|
|
20
|
+
kind: string;
|
|
21
|
+
/**
|
|
22
|
+
* The URL associated with the cookie. When not set it uses the request URL or the request URL of the last redirect.
|
|
23
|
+
*/
|
|
24
|
+
url?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Name of the cookie to remove.
|
|
27
|
+
* When not set it removes all cookies for the URL.
|
|
28
|
+
*/
|
|
29
|
+
name?: string;
|
|
30
|
+
static byName(name: string): DeleteCookieStep;
|
|
31
|
+
static byUrl(url: string): DeleteCookieStep;
|
|
32
|
+
/**
|
|
33
|
+
* Creates the step from serialized schema.
|
|
34
|
+
* @param init The serialized step values.
|
|
35
|
+
*/
|
|
36
|
+
constructor(init: IDeleteCookieStep);
|
|
37
|
+
/**
|
|
38
|
+
* Creates an empty step.
|
|
39
|
+
*/
|
|
40
|
+
constructor();
|
|
41
|
+
new(init: IDeleteCookieStep): void;
|
|
42
|
+
checkValidity(): boolean;
|
|
43
|
+
toJSON(): IDeleteCookieStep;
|
|
44
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { HttpStep } from "../../HttpStep.js";
|
|
2
|
+
export const DeleteCookieStepKind = 'HttpAction#DeleteCookie';
|
|
3
|
+
export class DeleteCookieStep extends HttpStep {
|
|
4
|
+
kind = DeleteCookieStepKind;
|
|
5
|
+
/**
|
|
6
|
+
* The URL associated with the cookie. When not set it uses the request URL or the request URL of the last redirect.
|
|
7
|
+
*/
|
|
8
|
+
url;
|
|
9
|
+
/**
|
|
10
|
+
* Name of the cookie to remove.
|
|
11
|
+
* When not set it removes all cookies for the URL.
|
|
12
|
+
*/
|
|
13
|
+
name;
|
|
14
|
+
static byName(name) {
|
|
15
|
+
return new DeleteCookieStep({
|
|
16
|
+
kind: DeleteCookieStepKind,
|
|
17
|
+
enabled: true,
|
|
18
|
+
name,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
static byUrl(url) {
|
|
22
|
+
return new DeleteCookieStep({
|
|
23
|
+
kind: DeleteCookieStepKind,
|
|
24
|
+
enabled: true,
|
|
25
|
+
url,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
constructor(init) {
|
|
29
|
+
super();
|
|
30
|
+
if (init) {
|
|
31
|
+
this.new(init);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
new(init) {
|
|
35
|
+
super.new(init);
|
|
36
|
+
this.kind = DeleteCookieStepKind;
|
|
37
|
+
if (init.url) {
|
|
38
|
+
this.url = init.url;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.url = undefined;
|
|
42
|
+
}
|
|
43
|
+
if (init.name) {
|
|
44
|
+
this.name = init.name;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.name = undefined;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
checkValidity() {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
toJSON() {
|
|
54
|
+
const result = {
|
|
55
|
+
...super.toJSON(),
|
|
56
|
+
kind: DeleteCookieStepKind,
|
|
57
|
+
};
|
|
58
|
+
if (this.url) {
|
|
59
|
+
result.url = this.url;
|
|
60
|
+
}
|
|
61
|
+
if (this.name) {
|
|
62
|
+
result.name = this.name;
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=DeleteCookieStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteCookieStep.js","sourceRoot":"","sources":["../../../../../../src/models/http-actions/steps/data/DeleteCookieStep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAmB9D,MAAM,OAAO,gBAAiB,SAAQ,QAAQ;IACnC,IAAI,GAAG,oBAAoB,CAAC;IAErC;;OAEG;IACH,GAAG,CAAU;IAEb;;;OAGG;IACH,IAAI,CAAU;IAEd,MAAM,CAAC,MAAM,CAAC,IAAY;QACxB,OAAO,IAAI,gBAAgB,CAAC;YAC1B,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,IAAI;YACb,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAW;QACtB,OAAO,IAAI,gBAAgB,CAAC;YAC1B,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,IAAI;YACb,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;IAaD,YAAY,IAAwB;QAClC,KAAK,EAAE,CAAC;QACR,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAChB;IACH,CAAC;IAEQ,GAAG,CAAC,IAAuB;QAClC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;SACrB;aAAM;YACL,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;SACtB;QACD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACvB;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;SACvB;IACH,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,MAAM;QACb,MAAM,MAAM,GAAsB;YAChC,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,IAAI,EAAE,oBAAoB;SAC3B,CAAC;QACF,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;SACvB;QACD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACzB;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { FlowRequestDataEnum, FlowResponseDataEnum, FlowSourceEnum } from "../../HttpFlows";
|
|
2
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
3
|
+
export declare const ReadDataSourceStepKind = "HttpAction#ReadDataSource";
|
|
4
|
+
/**
|
|
5
|
+
* A step similar to `ReadDataStep` but it does not search for a value by the path
|
|
6
|
+
* but returns the whole part of the request / response data (like status code,
|
|
7
|
+
* status message, response headers, response body, request body, etc)
|
|
8
|
+
*/
|
|
9
|
+
export interface IReadDataSourceStep extends IHttpStep {
|
|
10
|
+
/**
|
|
11
|
+
* The source of the data.
|
|
12
|
+
*/
|
|
13
|
+
source?: FlowSourceEnum;
|
|
14
|
+
/**
|
|
15
|
+
* The data to read.
|
|
16
|
+
*/
|
|
17
|
+
data?: FlowRequestDataEnum | FlowResponseDataEnum;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A step similar to `ReadDataStep` but it does not search for a value by the path
|
|
21
|
+
* but returns the whole part of the request / response data (like status code,
|
|
22
|
+
* status message, response headers, response body, request body, etc)
|
|
23
|
+
*/
|
|
24
|
+
export declare class ReadDataSourceStep extends HttpStep {
|
|
25
|
+
kind: string;
|
|
26
|
+
/**
|
|
27
|
+
* The source of the data.
|
|
28
|
+
*/
|
|
29
|
+
source?: FlowSourceEnum;
|
|
30
|
+
/**
|
|
31
|
+
* The data to read.
|
|
32
|
+
*/
|
|
33
|
+
data?: FlowRequestDataEnum | FlowResponseDataEnum;
|
|
34
|
+
/**
|
|
35
|
+
* Creates the step from values.
|
|
36
|
+
* @param source The main data source.
|
|
37
|
+
* @param path The path to the data.
|
|
38
|
+
* @param data Source of the data in the `source`. This is optional for non-http-request source.
|
|
39
|
+
*/
|
|
40
|
+
constructor(source: FlowSourceEnum, data: FlowRequestDataEnum | FlowResponseDataEnum);
|
|
41
|
+
/**
|
|
42
|
+
* Creates the step from serialized schema.
|
|
43
|
+
* @param init The serialized step values.
|
|
44
|
+
*/
|
|
45
|
+
constructor(init: IReadDataSourceStep);
|
|
46
|
+
/**
|
|
47
|
+
* Creates an empty step.
|
|
48
|
+
*/
|
|
49
|
+
constructor();
|
|
50
|
+
new(init: IReadDataSourceStep): void;
|
|
51
|
+
checkValidity(): boolean;
|
|
52
|
+
toJSON(): IReadDataSourceStep;
|
|
53
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { HttpStep } from "../../HttpStep.js";
|
|
2
|
+
export const ReadDataSourceStepKind = 'HttpAction#ReadDataSource';
|
|
3
|
+
/**
|
|
4
|
+
* A step similar to `ReadDataStep` but it does not search for a value by the path
|
|
5
|
+
* but returns the whole part of the request / response data (like status code,
|
|
6
|
+
* status message, response headers, response body, request body, etc)
|
|
7
|
+
*/
|
|
8
|
+
export class ReadDataSourceStep extends HttpStep {
|
|
9
|
+
kind = ReadDataSourceStepKind;
|
|
10
|
+
/**
|
|
11
|
+
* The source of the data.
|
|
12
|
+
*/
|
|
13
|
+
source;
|
|
14
|
+
/**
|
|
15
|
+
* The data to read.
|
|
16
|
+
*/
|
|
17
|
+
data;
|
|
18
|
+
constructor(sourceOrInit, data) {
|
|
19
|
+
super();
|
|
20
|
+
if (!sourceOrInit) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (typeof sourceOrInit === 'object') {
|
|
24
|
+
const typed = sourceOrInit;
|
|
25
|
+
this.new(typed);
|
|
26
|
+
}
|
|
27
|
+
else if (typeof sourceOrInit === 'string') {
|
|
28
|
+
this.new({
|
|
29
|
+
kind: ReadDataSourceStepKind,
|
|
30
|
+
source: sourceOrInit,
|
|
31
|
+
data,
|
|
32
|
+
enabled: true,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
new(init) {
|
|
37
|
+
super.new(init);
|
|
38
|
+
this.kind = ReadDataSourceStepKind;
|
|
39
|
+
this.source = init.source;
|
|
40
|
+
this.data = init.data;
|
|
41
|
+
}
|
|
42
|
+
checkValidity() {
|
|
43
|
+
const { source, data } = this;
|
|
44
|
+
return !!source && !!data;
|
|
45
|
+
}
|
|
46
|
+
toJSON() {
|
|
47
|
+
const result = {
|
|
48
|
+
...super.toJSON(),
|
|
49
|
+
kind: ReadDataSourceStepKind,
|
|
50
|
+
};
|
|
51
|
+
if (this.source) {
|
|
52
|
+
result.source = this.source;
|
|
53
|
+
}
|
|
54
|
+
if (this.data) {
|
|
55
|
+
result.data = this.data;
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=ReadDataSourceStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadDataSourceStep.js","sourceRoot":"","sources":["../../../../../../src/models/http-actions/steps/data/ReadDataSourceStep.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAmBlE;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IACrC,IAAI,GAAG,sBAAsB,CAAC;IAEvC;;OAEG;IACH,MAAM,CAAkB;IAExB;;OAEG;IACH,IAAI,CAA8C;IAqBlD,YAAY,YAAmD,EAAE,IAAiD;QAChH,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO;SACR;QACD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;YACpC,MAAM,KAAK,GAAG,YAAmC,CAAC;YAClD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACjB;aAAM,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;YAC3C,IAAI,CAAC,GAAG,CAAC;gBACP,IAAI,EAAE,sBAAsB;gBAC5B,MAAM,EAAE,YAAY;gBACpB,IAAI;gBACJ,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;SACJ;IACH,CAAC;IAEQ,GAAG,CAAC,IAAyB;QACpC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,aAAa;QACX,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QAC9B,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC;IAC5B,CAAC;IAEQ,MAAM;QACb,MAAM,MAAM,GAAwB;YAClC,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,IAAI,EAAE,sBAAsB;SAC7B,CAAC;QACF,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SAC7B;QACD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACzB;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { FlowRequestDataEnum, FlowResponseDataEnum, FlowSourceEnum } from "../../HttpFlows.js";
|
|
2
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
3
|
+
export declare const ReadDataStepKind = "HttpAction#ReadData";
|
|
4
|
+
/**
|
|
5
|
+
* Reads the data from various sources.
|
|
6
|
+
*/
|
|
7
|
+
export interface IReadDataStep extends IHttpStep {
|
|
8
|
+
kind: typeof ReadDataStepKind;
|
|
9
|
+
/**
|
|
10
|
+
* The main data source.
|
|
11
|
+
* In the legacy actions this was `type`.
|
|
12
|
+
*/
|
|
13
|
+
source?: FlowSourceEnum;
|
|
14
|
+
/**
|
|
15
|
+
* Source of the data.
|
|
16
|
+
* In the legacy actions this was `source`.
|
|
17
|
+
* This is not required when the source is not `request` or `response`.
|
|
18
|
+
*/
|
|
19
|
+
data?: FlowRequestDataEnum | FlowResponseDataEnum;
|
|
20
|
+
/**
|
|
21
|
+
* The path to the data.
|
|
22
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
23
|
+
* For XML use xpath.
|
|
24
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
25
|
+
*/
|
|
26
|
+
path?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare class ReadDataStep extends HttpStep {
|
|
29
|
+
kind: string;
|
|
30
|
+
/**
|
|
31
|
+
* The main data source.
|
|
32
|
+
* In the legacy actions this was `type`.
|
|
33
|
+
*/
|
|
34
|
+
source?: FlowSourceEnum;
|
|
35
|
+
/**
|
|
36
|
+
* Source of the data.
|
|
37
|
+
* In the legacy actions this was `source`.
|
|
38
|
+
* This is not required when the source is not `request` or `response`.
|
|
39
|
+
*/
|
|
40
|
+
data?: FlowRequestDataEnum | FlowResponseDataEnum;
|
|
41
|
+
/**
|
|
42
|
+
* The path to the data.
|
|
43
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
44
|
+
* For XML use xpath.
|
|
45
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
46
|
+
*/
|
|
47
|
+
path?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Creates the step from values.
|
|
50
|
+
* @param source The main data source.
|
|
51
|
+
* @param path The path to the data.
|
|
52
|
+
* @param data Source of the data in the `source`. This is optional for non-http-request source.
|
|
53
|
+
*/
|
|
54
|
+
constructor(source: FlowSourceEnum, path?: string, data?: FlowRequestDataEnum | FlowResponseDataEnum);
|
|
55
|
+
/**
|
|
56
|
+
* Creates the step from serialized schema.
|
|
57
|
+
* @param init The serialized step values.
|
|
58
|
+
*/
|
|
59
|
+
constructor(init: IReadDataStep);
|
|
60
|
+
/**
|
|
61
|
+
* Creates an empty step.
|
|
62
|
+
*/
|
|
63
|
+
constructor();
|
|
64
|
+
new(init: IReadDataStep): void;
|
|
65
|
+
checkValidity(): boolean;
|
|
66
|
+
toJSON(): IReadDataStep;
|
|
67
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { FlowSourceEnum } from "../../HttpFlows.js";
|
|
2
|
+
import { HttpStep } from "../../HttpStep.js";
|
|
3
|
+
export const ReadDataStepKind = 'HttpAction#ReadData';
|
|
4
|
+
export class ReadDataStep extends HttpStep {
|
|
5
|
+
kind = ReadDataStepKind;
|
|
6
|
+
/**
|
|
7
|
+
* The main data source.
|
|
8
|
+
* In the legacy actions this was `type`.
|
|
9
|
+
*/
|
|
10
|
+
source;
|
|
11
|
+
/**
|
|
12
|
+
* Source of the data.
|
|
13
|
+
* In the legacy actions this was `source`.
|
|
14
|
+
* This is not required when the source is not `request` or `response`.
|
|
15
|
+
*/
|
|
16
|
+
data;
|
|
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;
|
|
24
|
+
constructor(sourceOrInit, path, data) {
|
|
25
|
+
super();
|
|
26
|
+
if (!sourceOrInit) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (typeof sourceOrInit === 'object') {
|
|
30
|
+
const typed = sourceOrInit;
|
|
31
|
+
this.new(typed);
|
|
32
|
+
}
|
|
33
|
+
else if (typeof sourceOrInit === 'string') {
|
|
34
|
+
this.new({
|
|
35
|
+
kind: ReadDataStepKind,
|
|
36
|
+
source: sourceOrInit,
|
|
37
|
+
data,
|
|
38
|
+
path,
|
|
39
|
+
enabled: true,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
new(init) {
|
|
44
|
+
super.new(init);
|
|
45
|
+
this.kind = ReadDataStepKind;
|
|
46
|
+
this.source = init.source;
|
|
47
|
+
this.data = init.data;
|
|
48
|
+
this.path = init.path;
|
|
49
|
+
}
|
|
50
|
+
checkValidity() {
|
|
51
|
+
const { source, path, data } = this;
|
|
52
|
+
if (!source && !path) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
if (source === FlowSourceEnum.variable) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
return !!data;
|
|
59
|
+
}
|
|
60
|
+
toJSON() {
|
|
61
|
+
const result = {
|
|
62
|
+
...super.toJSON(),
|
|
63
|
+
kind: ReadDataStepKind,
|
|
64
|
+
};
|
|
65
|
+
if (this.source) {
|
|
66
|
+
result.source = this.source;
|
|
67
|
+
}
|
|
68
|
+
if (this.data) {
|
|
69
|
+
result.data = this.data;
|
|
70
|
+
}
|
|
71
|
+
if (this.path) {
|
|
72
|
+
result.path = this.path;
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=ReadDataStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadDataStep.js","sourceRoot":"","sources":["../../../../../../src/models/http-actions/steps/data/ReadDataStep.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AA2BtD,MAAM,OAAO,YAAa,SAAQ,QAAQ;IAC/B,IAAI,GAAG,gBAAgB,CAAC;IAEjC;;;OAGG;IACH,MAAM,CAAkB;IAExB;;;;OAIG;IACH,IAAI,CAA8C;IAElD;;;;;OAKG;IACH,IAAI,CAAU;IAqBd,YAAY,YAA6C,EAAE,IAAa,EAAE,IAAiD;QACzH,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO;SACR;QACD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;YACpC,MAAM,KAAK,GAAG,YAA6B,CAAC;YAC5C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACjB;aAAM,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;YAC3C,IAAI,CAAC,GAAG,CAAC;gBACP,IAAI,EAAE,gBAAgB;gBACtB,MAAM,EAAE,YAAY;gBACpB,IAAI;gBACJ,IAAI;gBACJ,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;SACJ;IACH,CAAC;IAEQ,GAAG,CAAC,IAAmB;QAC9B,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,aAAa;QACX,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACpC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE;YACpB,OAAO,KAAK,CAAC;SACd;QACD,IAAI,MAAM,KAAK,cAAc,CAAC,QAAQ,EAAE;YACtC,OAAO,IAAI,CAAC;SACb;QACD,OAAO,CAAC,CAAC,IAAI,CAAC;IAChB,CAAC;IAEQ,MAAM;QACb,MAAM,MAAM,GAAkB;YAC5B,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,IAAI,EAAE,gBAAgB;SACvB,CAAC;QACF,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SAC7B;QACD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACzB;QACD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACzB;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
export declare const ReadValueStepKind = "HttpAction#ReadValue";
|
|
3
|
+
/**
|
|
4
|
+
* Reads the value for a given path from the input data. This works with the `ReadDataSourceStep`.
|
|
5
|
+
*/
|
|
6
|
+
export interface IReadValueStep extends IHttpStep {
|
|
7
|
+
kind: typeof ReadValueStepKind;
|
|
8
|
+
/**
|
|
9
|
+
* The path to the data.
|
|
10
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
11
|
+
* For XML use xpath.
|
|
12
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
13
|
+
*/
|
|
14
|
+
path?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reads the value for a given path from the input data. This works with the `ReadDataSourceStep`.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ReadValueStep extends HttpStep {
|
|
20
|
+
kind: string;
|
|
21
|
+
/**
|
|
22
|
+
* The path to the data.
|
|
23
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
24
|
+
* For XML use xpath.
|
|
25
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
26
|
+
*/
|
|
27
|
+
path?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Creates the step from values.
|
|
30
|
+
* @param path The path to the data.
|
|
31
|
+
*/
|
|
32
|
+
constructor(path: string);
|
|
33
|
+
/**
|
|
34
|
+
* Creates the step from serialized schema.
|
|
35
|
+
* @param init The serialized step values.
|
|
36
|
+
*/
|
|
37
|
+
constructor(init: IReadValueStep);
|
|
38
|
+
/**
|
|
39
|
+
* Creates an empty step.
|
|
40
|
+
*/
|
|
41
|
+
constructor();
|
|
42
|
+
new(init: IReadValueStep): void;
|
|
43
|
+
checkValidity(): boolean;
|
|
44
|
+
toJSON(): IReadValueStep;
|
|
45
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { HttpStep } from "../../HttpStep.js";
|
|
2
|
+
export const ReadValueStepKind = 'HttpAction#ReadValue';
|
|
3
|
+
/**
|
|
4
|
+
* Reads the value for a given path from the input data. This works with the `ReadDataSourceStep`.
|
|
5
|
+
*/
|
|
6
|
+
export class ReadValueStep extends HttpStep {
|
|
7
|
+
kind = ReadValueStepKind;
|
|
8
|
+
/**
|
|
9
|
+
* The path to the data.
|
|
10
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
11
|
+
* For XML use xpath.
|
|
12
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
13
|
+
*/
|
|
14
|
+
path;
|
|
15
|
+
constructor(pathOrInit) {
|
|
16
|
+
super();
|
|
17
|
+
if (!pathOrInit) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (typeof pathOrInit === 'object') {
|
|
21
|
+
const typed = pathOrInit;
|
|
22
|
+
this.new(typed);
|
|
23
|
+
}
|
|
24
|
+
else if (typeof pathOrInit === 'string') {
|
|
25
|
+
this.new({
|
|
26
|
+
kind: ReadValueStepKind,
|
|
27
|
+
path: pathOrInit,
|
|
28
|
+
enabled: true,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
new(init) {
|
|
33
|
+
super.new(init);
|
|
34
|
+
this.kind = ReadValueStepKind;
|
|
35
|
+
this.path = init.path;
|
|
36
|
+
}
|
|
37
|
+
checkValidity() {
|
|
38
|
+
const { path } = this;
|
|
39
|
+
return !!path;
|
|
40
|
+
}
|
|
41
|
+
toJSON() {
|
|
42
|
+
const result = {
|
|
43
|
+
...super.toJSON(),
|
|
44
|
+
kind: ReadValueStepKind,
|
|
45
|
+
};
|
|
46
|
+
if (this.path) {
|
|
47
|
+
result.path = this.path;
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=ReadValueStep.js.map
|