@api-client/core 0.9.4 → 0.9.5
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 +12 -2
- package/build/browser.js +15 -2
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +13 -3
- package/build/index.js +16 -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/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/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/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/ProjectParallelRunner.d.ts +1 -1
- 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/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/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/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/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/ProjectParallelRunner.ts +4 -4
- package/src/runtime/node/ProjectRequestRunner.ts +6 -2
- 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,52 @@
|
|
|
1
|
+
export var AssertionEnum;
|
|
2
|
+
(function (AssertionEnum) {
|
|
3
|
+
AssertionEnum["equal"] = "equal";
|
|
4
|
+
AssertionEnum["notEqual"] = "not-equal";
|
|
5
|
+
AssertionEnum["greaterThan"] = "greater-than";
|
|
6
|
+
AssertionEnum["greaterThanEqual"] = "greater-than-equal";
|
|
7
|
+
AssertionEnum["lessThan"] = "less-than";
|
|
8
|
+
AssertionEnum["lessThanEqual"] = "less-than-equal";
|
|
9
|
+
AssertionEnum["contains"] = "contains";
|
|
10
|
+
AssertionEnum["regex"] = "regex";
|
|
11
|
+
AssertionEnum["ok"] = "ok";
|
|
12
|
+
AssertionEnum["notOk"] = "notOk";
|
|
13
|
+
AssertionEnum["toBe"] = "toBe";
|
|
14
|
+
AssertionEnum["notToBe"] = "notToBe";
|
|
15
|
+
})(AssertionEnum || (AssertionEnum = {}));
|
|
16
|
+
export var TransformationEnum;
|
|
17
|
+
(function (TransformationEnum) {
|
|
18
|
+
/**
|
|
19
|
+
* Transformation of the data that reads a value from the given path.
|
|
20
|
+
* For example, for a body it can be xpath for XML or JSON path for JSON data.
|
|
21
|
+
*/
|
|
22
|
+
TransformationEnum["readValue"] = "readValue";
|
|
23
|
+
/**
|
|
24
|
+
* Transforms the value from the previous step to a number.
|
|
25
|
+
*/
|
|
26
|
+
TransformationEnum["asNumber"] = "asNumber";
|
|
27
|
+
/**
|
|
28
|
+
* Rounds the input value to a nearest numeric value.
|
|
29
|
+
* If the value is not a number it tries to convert it to a number. When it
|
|
30
|
+
* can't ba casted to a number then the transformation throws an error.
|
|
31
|
+
*/
|
|
32
|
+
TransformationEnum["round"] = "round";
|
|
33
|
+
/**
|
|
34
|
+
* Transforms the value to a lowercase value.
|
|
35
|
+
*/
|
|
36
|
+
TransformationEnum["toLowerCase"] = "toLowerCase";
|
|
37
|
+
/**
|
|
38
|
+
* Transforms the value to a uppercase value.
|
|
39
|
+
*/
|
|
40
|
+
TransformationEnum["toUpperCase"] = "toUpperCase";
|
|
41
|
+
/**
|
|
42
|
+
* Trims the string value.
|
|
43
|
+
*/
|
|
44
|
+
TransformationEnum["trim"] = "trim";
|
|
45
|
+
/**
|
|
46
|
+
* Transforms the part of the string from the start index up to and excluding the end index, or to the end of the string if no end index is supplied.
|
|
47
|
+
*
|
|
48
|
+
* `substring(indexStart, indexEnd)`
|
|
49
|
+
*/
|
|
50
|
+
TransformationEnum["substring"] = "substring";
|
|
51
|
+
})(TransformationEnum || (TransformationEnum = {}));
|
|
52
|
+
//# sourceMappingURL=HttpAssertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpAssertion.js","sourceRoot":"","sources":["../../../../src/models/http-actions/HttpAssertion.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,aAaX;AAbD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,uCAAsB,CAAA;IACtB,6CAA4B,CAAA;IAC5B,wDAAuC,CAAA;IACvC,uCAAsB,CAAA;IACtB,kDAAiC,CAAA;IACjC,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,0BAAS,CAAA;IACT,gCAAe,CAAA;IACf,8BAAa,CAAA;IACb,oCAAmB,CAAA;AACrB,CAAC,EAbW,aAAa,KAAb,aAAa,QAaxB;AAED,MAAM,CAAN,IAAY,kBAkCX;AAlCD,WAAY,kBAAkB;IAC5B;;;OAGG;IACH,6CAAuB,CAAA;IACvB;;OAEG;IACH,2CAAqB,CAAA;IACrB;;;;OAIG;IACH,qCAAe,CAAA;IACf;;OAEG;IACH,iDAA2B,CAAA;IAC3B;;OAEG;IACH,iDAA2B,CAAA;IAC3B;;OAEG;IACH,mCAAa,CAAA;IACb;;;;OAIG;IACH,6CAAuB,CAAA;AACzB,CAAC,EAlCW,kBAAkB,KAAlB,kBAAkB,QAkC7B"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { AssertionEnum } from './HttpAssertion.js';
|
|
2
|
+
import { IHttpStep } from './HttpStep.js';
|
|
3
|
+
export declare enum FlowSourceEnum {
|
|
4
|
+
/**
|
|
5
|
+
* The request object.
|
|
6
|
+
*/
|
|
7
|
+
request = "request",
|
|
8
|
+
/**
|
|
9
|
+
* The response object.
|
|
10
|
+
*/
|
|
11
|
+
response = "response",
|
|
12
|
+
/**
|
|
13
|
+
* A variable from the current environment.
|
|
14
|
+
*/
|
|
15
|
+
variable = "variable"
|
|
16
|
+
}
|
|
17
|
+
export declare enum FlowRequestDataEnum {
|
|
18
|
+
url = "url",
|
|
19
|
+
method = "method",
|
|
20
|
+
headers = "headers",
|
|
21
|
+
body = "body"
|
|
22
|
+
}
|
|
23
|
+
export declare enum FlowResponseDataEnum {
|
|
24
|
+
url = "url",
|
|
25
|
+
status = "status",
|
|
26
|
+
statusText = "statusText",
|
|
27
|
+
headers = "headers",
|
|
28
|
+
body = "body"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A flow represents a series of actions to be performed one-by-one after the HTTP request is sent or when the response
|
|
32
|
+
* is ready.
|
|
33
|
+
*/
|
|
34
|
+
export interface IHttpFlow {
|
|
35
|
+
/**
|
|
36
|
+
* The description of the flow
|
|
37
|
+
*/
|
|
38
|
+
description?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Describes when the flow is executed.
|
|
41
|
+
* The `request` means the flow is executed before the request is sent to the HTTP engine.
|
|
42
|
+
* The `response` means the flow is executed after the response has been received in full, but before reporting
|
|
43
|
+
* the response to the UI.
|
|
44
|
+
*/
|
|
45
|
+
trigger: 'request' | 'response';
|
|
46
|
+
/**
|
|
47
|
+
* The ordered list of actions to execute.
|
|
48
|
+
*/
|
|
49
|
+
actions: IHttpAction[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Describes a single action in a flow.
|
|
53
|
+
* An action can have a condition that is checked against the current context.
|
|
54
|
+
* Action is not executed when the condition is not meet.
|
|
55
|
+
*
|
|
56
|
+
* Each action has one or more steps (when 0 items then the action is ignored). Each step performs a task.
|
|
57
|
+
* The result of a task is passed to the next step as an input. The result of a task may be `void`, `null`, or `undefined` which is treated as `void`.
|
|
58
|
+
*/
|
|
59
|
+
export interface IHttpAction {
|
|
60
|
+
/**
|
|
61
|
+
* The description of the action
|
|
62
|
+
*/
|
|
63
|
+
description?: string;
|
|
64
|
+
/**
|
|
65
|
+
* A condition to check before performing the action.
|
|
66
|
+
*/
|
|
67
|
+
condition?: IHttpCondition;
|
|
68
|
+
/**
|
|
69
|
+
* The list of steps to perform. This is an ordered list of action tasks.
|
|
70
|
+
* Each step is described by the `kind` property which tells the runner what action to perform.
|
|
71
|
+
*/
|
|
72
|
+
steps: IHttpStep[];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A condition to execute for an action.
|
|
76
|
+
*/
|
|
77
|
+
export interface IHttpCondition {
|
|
78
|
+
/**
|
|
79
|
+
* The main data source.
|
|
80
|
+
* In the legacy actions this was `type`.
|
|
81
|
+
*/
|
|
82
|
+
source?: FlowSourceEnum;
|
|
83
|
+
/**
|
|
84
|
+
* Source of the data.
|
|
85
|
+
* In the legacy actions this was `source`.
|
|
86
|
+
* This is not required when the source is not `request` or `response`.
|
|
87
|
+
*/
|
|
88
|
+
data?: FlowRequestDataEnum | FlowResponseDataEnum;
|
|
89
|
+
/**
|
|
90
|
+
* The path to the data.
|
|
91
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
92
|
+
* For XML use xpath.
|
|
93
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
94
|
+
*/
|
|
95
|
+
path?: string;
|
|
96
|
+
/**
|
|
97
|
+
* The comparison operator.
|
|
98
|
+
*/
|
|
99
|
+
operator?: AssertionEnum;
|
|
100
|
+
/**
|
|
101
|
+
* The value to compare the read result.
|
|
102
|
+
* In runtime, the type is casted to the same type as read value.
|
|
103
|
+
*
|
|
104
|
+
* When this is not set it compares to an empty string value or `0`.
|
|
105
|
+
*
|
|
106
|
+
* In ARC actions this was the `predictedValue`.
|
|
107
|
+
*/
|
|
108
|
+
value?: string;
|
|
109
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export var FlowSourceEnum;
|
|
2
|
+
(function (FlowSourceEnum) {
|
|
3
|
+
/**
|
|
4
|
+
* The request object.
|
|
5
|
+
*/
|
|
6
|
+
FlowSourceEnum["request"] = "request";
|
|
7
|
+
/**
|
|
8
|
+
* The response object.
|
|
9
|
+
*/
|
|
10
|
+
FlowSourceEnum["response"] = "response";
|
|
11
|
+
/**
|
|
12
|
+
* A variable from the current environment.
|
|
13
|
+
*/
|
|
14
|
+
FlowSourceEnum["variable"] = "variable";
|
|
15
|
+
})(FlowSourceEnum || (FlowSourceEnum = {}));
|
|
16
|
+
export var FlowRequestDataEnum;
|
|
17
|
+
(function (FlowRequestDataEnum) {
|
|
18
|
+
FlowRequestDataEnum["url"] = "url";
|
|
19
|
+
FlowRequestDataEnum["method"] = "method";
|
|
20
|
+
FlowRequestDataEnum["headers"] = "headers";
|
|
21
|
+
FlowRequestDataEnum["body"] = "body";
|
|
22
|
+
})(FlowRequestDataEnum || (FlowRequestDataEnum = {}));
|
|
23
|
+
export var FlowResponseDataEnum;
|
|
24
|
+
(function (FlowResponseDataEnum) {
|
|
25
|
+
FlowResponseDataEnum["url"] = "url";
|
|
26
|
+
FlowResponseDataEnum["status"] = "status";
|
|
27
|
+
FlowResponseDataEnum["statusText"] = "statusText";
|
|
28
|
+
FlowResponseDataEnum["headers"] = "headers";
|
|
29
|
+
FlowResponseDataEnum["body"] = "body";
|
|
30
|
+
})(FlowResponseDataEnum || (FlowResponseDataEnum = {}));
|
|
31
|
+
//# sourceMappingURL=HttpFlows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpFlows.js","sourceRoot":"","sources":["../../../../src/models/http-actions/HttpFlows.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,cAaX;AAbD,WAAY,cAAc;IACxB;;OAEG;IACH,qCAAmB,CAAA;IACnB;;OAEG;IACH,uCAAqB,CAAA;IACrB;;OAEG;IACH,uCAAqB,CAAA;AACvB,CAAC,EAbW,cAAc,KAAd,cAAc,QAazB;AAED,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,wCAAiB,CAAA;IACjB,0CAAmB,CAAA;IACnB,oCAAa,CAAA;AACf,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAED,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,yCAAiB,CAAA;IACjB,iDAAyB,CAAA;IACzB,2CAAmB,CAAA;IACnB,qCAAa,CAAA;AACf,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The action that can be taken on the data.
|
|
3
|
+
*/
|
|
4
|
+
export interface IHttpStep {
|
|
5
|
+
/**
|
|
6
|
+
* The kind of the action to perform.
|
|
7
|
+
*/
|
|
8
|
+
kind: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the step is disabled in the flow.
|
|
11
|
+
*/
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare abstract class HttpStep {
|
|
15
|
+
/**
|
|
16
|
+
* The kind of the action to perform.
|
|
17
|
+
*/
|
|
18
|
+
kind: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the step is disabled in the flow.
|
|
21
|
+
*/
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
new(init: IHttpStep): void;
|
|
24
|
+
toJSON(): IHttpStep;
|
|
25
|
+
/**
|
|
26
|
+
* A function that returns true when the step is valid and can be executed.
|
|
27
|
+
*/
|
|
28
|
+
abstract checkValidity(): boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class HttpStep {
|
|
2
|
+
/**
|
|
3
|
+
* The kind of the action to perform.
|
|
4
|
+
*/
|
|
5
|
+
kind = '';
|
|
6
|
+
/**
|
|
7
|
+
* Whether the step is disabled in the flow.
|
|
8
|
+
*/
|
|
9
|
+
enabled;
|
|
10
|
+
new(init) {
|
|
11
|
+
const { kind, enabled } = init;
|
|
12
|
+
this.kind = kind;
|
|
13
|
+
if (typeof enabled === 'boolean') {
|
|
14
|
+
this.enabled = enabled;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.enabled = undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
toJSON() {
|
|
21
|
+
const result = {
|
|
22
|
+
kind: this.kind,
|
|
23
|
+
};
|
|
24
|
+
if (typeof this.enabled === 'boolean') {
|
|
25
|
+
result.enabled = this.enabled;
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=HttpStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpStep.js","sourceRoot":"","sources":["../../../../src/models/http-actions/HttpStep.ts"],"names":[],"mappings":"AAcA,MAAM,OAAgB,QAAQ;IAC5B;;OAEG;IACH,IAAI,GAAG,EAAE,CAAC;IAEV;;OAEG;IACH,OAAO,CAAW;IAElB,GAAG,CAAC,IAAe;QACjB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,OAAO,OAAO,KAAK,SAAS,EAAE;YAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;SACvB;aAAM;YACL,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;SAC1B;IACH,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAc;YACxB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAA;QACD,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YACrC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;SAC/B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CAMF"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { RequestActions as LegacyRequestActions } from '../../models/legacy/request/ArcRequest.js';
|
|
2
2
|
import { RunnableAction as LegacyRunnable, Condition as LegacyCondition, Action as LegacyAction, DataSourceConfiguration } from '../../models/legacy/actions/Actions.js';
|
|
3
|
-
import {
|
|
3
|
+
import { IHttpFlow, IHttpAction, IHttpCondition } from './HttpFlows.js';
|
|
4
|
+
import { IHttpStep } from './HttpStep.js';
|
|
4
5
|
/**
|
|
5
6
|
* Allows to translate the old ARC actions into Action flows.
|
|
6
7
|
*/
|
|
7
8
|
export declare class LegacyTranslator {
|
|
8
|
-
static translate(action: LegacyRequestActions):
|
|
9
|
+
static translate(action: LegacyRequestActions): IHttpFlow[];
|
|
9
10
|
protected static _translateRunnables(runnables: LegacyRunnable[]): IHttpAction[];
|
|
10
11
|
protected static _translateRunnable(runnable: LegacyRunnable): IHttpAction[];
|
|
11
12
|
protected static _translateCondition(runnable: LegacyCondition): IHttpCondition | undefined;
|
|
12
|
-
protected static _translateAction(item: LegacyAction):
|
|
13
|
-
protected static _translateSetCookieAction(item: LegacyAction):
|
|
14
|
-
protected static _translateSetVariableAction(item: LegacyAction):
|
|
15
|
-
protected static _translateDeleteCookieAction(item: LegacyAction):
|
|
16
|
-
protected static _translateDataSource(source: DataSourceConfiguration):
|
|
13
|
+
protected static _translateAction(item: LegacyAction): IHttpStep[];
|
|
14
|
+
protected static _translateSetCookieAction(item: LegacyAction): IHttpStep[];
|
|
15
|
+
protected static _translateSetVariableAction(item: LegacyAction): IHttpStep[];
|
|
16
|
+
protected static _translateDeleteCookieAction(item: LegacyAction): IHttpStep[];
|
|
17
|
+
protected static _translateDataSource(source: DataSourceConfiguration): IHttpStep;
|
|
17
18
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlowSourceEnum, } from './HttpFlows.js';
|
|
2
2
|
import { AmfNamespace } from '../../amf/definitions/Namespace.js';
|
|
3
|
+
import { AssertionEnum } from './HttpAssertion.js';
|
|
4
|
+
import { ReadDataStepKind } from './steps/data/ReadDataStep.js';
|
|
5
|
+
import { SetDataStepKind } from './steps/data/SetDataStep.js';
|
|
6
|
+
import { SetCookieStepKind } from './steps/data/SetCookieStep.js';
|
|
7
|
+
import { DeleteCookieStepKind } from './steps/data/DeleteCookieStep.js';
|
|
3
8
|
/**
|
|
4
9
|
* Allows to translate the old ARC actions into Action flows.
|
|
5
10
|
*/
|
|
@@ -58,10 +63,10 @@ export class LegacyTranslator {
|
|
|
58
63
|
if (type) {
|
|
59
64
|
switch (type) {
|
|
60
65
|
case 'request':
|
|
61
|
-
result.source =
|
|
66
|
+
result.source = FlowSourceEnum.request;
|
|
62
67
|
break;
|
|
63
68
|
case 'response':
|
|
64
|
-
result.source =
|
|
69
|
+
result.source = FlowSourceEnum.response;
|
|
65
70
|
break;
|
|
66
71
|
}
|
|
67
72
|
}
|
|
@@ -79,28 +84,28 @@ export class LegacyTranslator {
|
|
|
79
84
|
if (operator) {
|
|
80
85
|
switch (operator) {
|
|
81
86
|
case 'contains':
|
|
82
|
-
result.operator =
|
|
87
|
+
result.operator = AssertionEnum.contains;
|
|
83
88
|
break;
|
|
84
89
|
case 'equal':
|
|
85
|
-
result.operator =
|
|
90
|
+
result.operator = AssertionEnum.equal;
|
|
86
91
|
break;
|
|
87
92
|
case 'greater-than':
|
|
88
|
-
result.operator =
|
|
93
|
+
result.operator = AssertionEnum.greaterThan;
|
|
89
94
|
break;
|
|
90
95
|
case 'greater-than-equal':
|
|
91
|
-
result.operator =
|
|
96
|
+
result.operator = AssertionEnum.greaterThanEqual;
|
|
92
97
|
break;
|
|
93
98
|
case 'less-than':
|
|
94
|
-
result.operator =
|
|
99
|
+
result.operator = AssertionEnum.lessThan;
|
|
95
100
|
break;
|
|
96
101
|
case 'less-than-equal':
|
|
97
|
-
result.operator =
|
|
102
|
+
result.operator = AssertionEnum.lessThanEqual;
|
|
98
103
|
break;
|
|
99
104
|
case 'not-equal':
|
|
100
|
-
result.operator =
|
|
105
|
+
result.operator = AssertionEnum.notEqual;
|
|
101
106
|
break;
|
|
102
107
|
case 'regex':
|
|
103
|
-
result.operator =
|
|
108
|
+
result.operator = AssertionEnum.regex;
|
|
104
109
|
break;
|
|
105
110
|
}
|
|
106
111
|
}
|
|
@@ -201,10 +206,10 @@ export class LegacyTranslator {
|
|
|
201
206
|
if (type) {
|
|
202
207
|
switch (type) {
|
|
203
208
|
case 'request':
|
|
204
|
-
result.source =
|
|
209
|
+
result.source = FlowSourceEnum.request;
|
|
205
210
|
break;
|
|
206
211
|
case 'response':
|
|
207
|
-
result.source =
|
|
212
|
+
result.source = FlowSourceEnum.response;
|
|
208
213
|
break;
|
|
209
214
|
}
|
|
210
215
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyTranslator.js","sourceRoot":"","sources":["../../../../src/models/http-actions/LegacyTranslator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LegacyTranslator.js","sourceRoot":"","sources":["../../../../src/models/http-actions/LegacyTranslator.ts"],"names":[],"mappings":"AAKA,OAAO,EACmC,cAAc,GAEvD,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAiB,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAgB,eA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CAAC;QAEnB,OAAO,KAAK,CAAC;IACf,CAAC;IAES,MAAM,CAAC,oBAAoB,CAAC,MAA+B;QACnE,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,MAAM,OAAO,GAAiB;gBAC5B,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,QAAQ,EAAE,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM;aAC3C,CAAC;YACF,OAAO,OAAO,CAAC;SAChB;QAED,4EAA4E;QAC5E,0CAA0C;QAE1C,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QACpD,MAAM,MAAM,GAAkB;YAC5B,IAAI,EAAE,gBAAgB;SACvB,CAAC;QAEF,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;SACpB;QACD,IAAI,IAAI,EAAE;YACR,QAAQ,IAAI,EAAE;gBACZ,KAAK,SAAS;oBAAE,MAAM,CAAC,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC;oBAAC,MAAM;gBAC9D,KAAK,UAAU;oBAAE,MAAM,CAAC,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC;oBAAC,MAAM;aACjE;SACF;QACD,IAAI,IAAI,IAAI,YAAY,EAAE;YACxB,IAAI,IAAI,KAAK,SAAS,EAAE;gBACtB,MAAM,CAAC,IAAI,GAAG,YAAmC,CAAC;aACnD;YACD,IAAI,IAAI,KAAK,UAAU,EAAE;gBACvB,MAAM,CAAC,IAAI,GAAG,YAAoC,CAAC;aACpD;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
export declare const EqualAssertionKind = "HttpAction#EqualAssertion";
|
|
3
|
+
/**
|
|
4
|
+
* An assertion that makes sure the input value is [strict] equal to the set value.
|
|
5
|
+
*/
|
|
6
|
+
export interface IEqualAssertion extends IHttpStep {
|
|
7
|
+
kind: typeof EqualAssertionKind;
|
|
8
|
+
/**
|
|
9
|
+
* The value to compare to.
|
|
10
|
+
* This is always a string. Use the `dataType` to determine the correct data type.
|
|
11
|
+
*/
|
|
12
|
+
value?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The data type of the value. This is a value prefixed with
|
|
15
|
+
* `http://www.w3.org/2001/XMLSchema#` or `http://a.ml/vocabularies/shapes#`.
|
|
16
|
+
*
|
|
17
|
+
* Examples:
|
|
18
|
+
*
|
|
19
|
+
* - `http://www.w3.org/2001/XMLSchema#boolean`
|
|
20
|
+
* - `http://www.w3.org/2001/XMLSchema#string`
|
|
21
|
+
* - `http://www.w3.org/2001/XMLSchema#number`
|
|
22
|
+
* - `http://www.w3.org/2001/XMLSchema#integer`
|
|
23
|
+
* - `http://www.w3.org/2001/XMLSchema#long`
|
|
24
|
+
* - `http://a.ml/vocabularies/shapes#number`
|
|
25
|
+
* - `http://a.ml/vocabularies/shapes#integer`
|
|
26
|
+
* - `http://a.ml/vocabularies/shapes#double`
|
|
27
|
+
* - ...
|
|
28
|
+
*
|
|
29
|
+
* @default `http://www.w3.org/2001/XMLSchema#string`
|
|
30
|
+
*/
|
|
31
|
+
dataType?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether it should check for a value and the data type.
|
|
34
|
+
*/
|
|
35
|
+
strict?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An assertion that makes sure the input value is [strict] equal to the set value.
|
|
39
|
+
*/
|
|
40
|
+
export declare class EqualAssertion extends HttpStep {
|
|
41
|
+
kind: string;
|
|
42
|
+
/**
|
|
43
|
+
* The value to compare to.
|
|
44
|
+
* This is always a string. Use the `dataType` to determine the correct data type.
|
|
45
|
+
*/
|
|
46
|
+
value?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The data type of the value. This is a value prefixed with
|
|
49
|
+
* `http://www.w3.org/2001/XMLSchema#` or `http://a.ml/vocabularies/shapes#`.
|
|
50
|
+
*
|
|
51
|
+
* Examples:
|
|
52
|
+
*
|
|
53
|
+
* - `http://www.w3.org/2001/XMLSchema#boolean`
|
|
54
|
+
* - `http://www.w3.org/2001/XMLSchema#string`
|
|
55
|
+
* - `http://www.w3.org/2001/XMLSchema#number`
|
|
56
|
+
* - `http://www.w3.org/2001/XMLSchema#integer`
|
|
57
|
+
* - `http://www.w3.org/2001/XMLSchema#long`
|
|
58
|
+
* - `http://a.ml/vocabularies/shapes#number`
|
|
59
|
+
* - `http://a.ml/vocabularies/shapes#integer`
|
|
60
|
+
* - `http://a.ml/vocabularies/shapes#double`
|
|
61
|
+
* - ...
|
|
62
|
+
*
|
|
63
|
+
* @default `http://www.w3.org/2001/XMLSchema#string`
|
|
64
|
+
*/
|
|
65
|
+
dataType?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Whether it should check for a value and the data type.
|
|
68
|
+
*/
|
|
69
|
+
strict?: boolean;
|
|
70
|
+
constructor(value: string, strict?: boolean, dataType?: string);
|
|
71
|
+
constructor(init: IEqualAssertion);
|
|
72
|
+
constructor();
|
|
73
|
+
new(init: IEqualAssertion): void;
|
|
74
|
+
checkValidity(): boolean;
|
|
75
|
+
toJSON(): IEqualAssertion;
|
|
76
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { HttpStep } from "../../HttpStep.js";
|
|
2
|
+
export const EqualAssertionKind = 'HttpAction#EqualAssertion';
|
|
3
|
+
/**
|
|
4
|
+
* An assertion that makes sure the input value is [strict] equal to the set value.
|
|
5
|
+
*/
|
|
6
|
+
export class EqualAssertion extends HttpStep {
|
|
7
|
+
kind = EqualAssertionKind;
|
|
8
|
+
/**
|
|
9
|
+
* The value to compare to.
|
|
10
|
+
* This is always a string. Use the `dataType` to determine the correct data type.
|
|
11
|
+
*/
|
|
12
|
+
value;
|
|
13
|
+
/**
|
|
14
|
+
* The data type of the value. This is a value prefixed with
|
|
15
|
+
* `http://www.w3.org/2001/XMLSchema#` or `http://a.ml/vocabularies/shapes#`.
|
|
16
|
+
*
|
|
17
|
+
* Examples:
|
|
18
|
+
*
|
|
19
|
+
* - `http://www.w3.org/2001/XMLSchema#boolean`
|
|
20
|
+
* - `http://www.w3.org/2001/XMLSchema#string`
|
|
21
|
+
* - `http://www.w3.org/2001/XMLSchema#number`
|
|
22
|
+
* - `http://www.w3.org/2001/XMLSchema#integer`
|
|
23
|
+
* - `http://www.w3.org/2001/XMLSchema#long`
|
|
24
|
+
* - `http://a.ml/vocabularies/shapes#number`
|
|
25
|
+
* - `http://a.ml/vocabularies/shapes#integer`
|
|
26
|
+
* - `http://a.ml/vocabularies/shapes#double`
|
|
27
|
+
* - ...
|
|
28
|
+
*
|
|
29
|
+
* @default `http://www.w3.org/2001/XMLSchema#string`
|
|
30
|
+
*/
|
|
31
|
+
dataType;
|
|
32
|
+
/**
|
|
33
|
+
* Whether it should check for a value and the data type.
|
|
34
|
+
*/
|
|
35
|
+
strict;
|
|
36
|
+
constructor(valueOrInit, strict, dataType) {
|
|
37
|
+
super();
|
|
38
|
+
if (typeof valueOrInit === 'object') {
|
|
39
|
+
const typed = valueOrInit;
|
|
40
|
+
this.new(typed);
|
|
41
|
+
}
|
|
42
|
+
else if (typeof valueOrInit === 'string') {
|
|
43
|
+
this.new({
|
|
44
|
+
kind: EqualAssertionKind,
|
|
45
|
+
value: valueOrInit,
|
|
46
|
+
dataType,
|
|
47
|
+
strict,
|
|
48
|
+
enabled: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
new(init) {
|
|
53
|
+
super.new(init);
|
|
54
|
+
this.kind = EqualAssertionKind;
|
|
55
|
+
this.value = init.value;
|
|
56
|
+
this.dataType = init.dataType;
|
|
57
|
+
this.strict = init.strict;
|
|
58
|
+
}
|
|
59
|
+
checkValidity() {
|
|
60
|
+
return !!this.value;
|
|
61
|
+
}
|
|
62
|
+
toJSON() {
|
|
63
|
+
const result = {
|
|
64
|
+
...super.toJSON(),
|
|
65
|
+
kind: EqualAssertionKind,
|
|
66
|
+
};
|
|
67
|
+
if (this.value) {
|
|
68
|
+
result.value = this.value;
|
|
69
|
+
}
|
|
70
|
+
if (this.dataType) {
|
|
71
|
+
result.dataType = this.dataType;
|
|
72
|
+
}
|
|
73
|
+
if (typeof this.strict === 'boolean') {
|
|
74
|
+
result.strict = this.strict;
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=EqualAssertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EqualAssertion.js","sourceRoot":"","sources":["../../../../../../src/models/http-actions/steps/assertion/EqualAssertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAwC9D;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAQ;IACjC,IAAI,GAAG,kBAAkB,CAAC;IAEnC;;;OAGG;IACH,KAAK,CAAU;IAEf;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAU;IAElB;;OAEG;IACH,MAAM,CAAW;IAQjB,YAAY,WAAsC,EAAE,MAAgB,EAAE,QAAiB;QACrF,KAAK,EAAE,CAAC;QACR,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACnC,MAAM,KAAK,GAAG,WAA8B,CAAC;YAC7C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACjB;aAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YAC1C,IAAI,CAAC,GAAG,CAAC;gBACP,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,WAAW;gBAClB,QAAQ;gBACR,MAAM;gBACN,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;SACJ;IACH,CAAC;IAEQ,GAAG,CAAC,IAAqB;QAChC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;IAED,aAAa;QACX,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAEQ,MAAM;QACb,MAAM,MAAM,GAAoB;YAC9B,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,IAAI,EAAE,kBAAkB;SACzB,CAAC;QACF,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;SAC3B;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;SACjC;QACD,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;YACpC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { HttpStep, IHttpStep } from "../../HttpStep.js";
|
|
2
|
+
export declare const GreaterThanAssertionKind = "HttpAction#GreaterThanAssertion";
|
|
3
|
+
/**
|
|
4
|
+
* An assertion that makes sure the input value is greater [or equal] to the set value.
|
|
5
|
+
*/
|
|
6
|
+
export interface IGreaterThanAssertion extends IHttpStep {
|
|
7
|
+
kind: typeof GreaterThanAssertionKind;
|
|
8
|
+
/**
|
|
9
|
+
* The value to compare to.
|
|
10
|
+
*/
|
|
11
|
+
value?: number;
|
|
12
|
+
/**
|
|
13
|
+
* When set it treats the assertion as "greater than or equal"
|
|
14
|
+
*/
|
|
15
|
+
equal?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* An assertion that makes sure the input value is greater [or equal] to the set value.
|
|
19
|
+
*/
|
|
20
|
+
export declare class GreaterThanAssertion extends HttpStep {
|
|
21
|
+
kind: string;
|
|
22
|
+
/**
|
|
23
|
+
* The value to compare to.
|
|
24
|
+
*/
|
|
25
|
+
value?: number;
|
|
26
|
+
/**
|
|
27
|
+
* When set it treats the assertion as "greater than or equal"
|
|
28
|
+
*/
|
|
29
|
+
equal?: boolean;
|
|
30
|
+
constructor(value: number, equal?: boolean);
|
|
31
|
+
constructor(init: IGreaterThanAssertion);
|
|
32
|
+
constructor();
|
|
33
|
+
new(init: IGreaterThanAssertion): void;
|
|
34
|
+
checkValidity(): boolean;
|
|
35
|
+
toJSON(): IGreaterThanAssertion;
|
|
36
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { HttpStep } from "../../HttpStep.js";
|
|
2
|
+
export const GreaterThanAssertionKind = 'HttpAction#GreaterThanAssertion';
|
|
3
|
+
/**
|
|
4
|
+
* An assertion that makes sure the input value is greater [or equal] to the set value.
|
|
5
|
+
*/
|
|
6
|
+
export class GreaterThanAssertion extends HttpStep {
|
|
7
|
+
kind = GreaterThanAssertionKind;
|
|
8
|
+
/**
|
|
9
|
+
* The value to compare to.
|
|
10
|
+
*/
|
|
11
|
+
value;
|
|
12
|
+
/**
|
|
13
|
+
* When set it treats the assertion as "greater than or equal"
|
|
14
|
+
*/
|
|
15
|
+
equal;
|
|
16
|
+
constructor(valueOrInit, equal) {
|
|
17
|
+
super();
|
|
18
|
+
if (typeof valueOrInit === 'object') {
|
|
19
|
+
const typed = valueOrInit;
|
|
20
|
+
this.new(typed);
|
|
21
|
+
}
|
|
22
|
+
else if (typeof valueOrInit === 'number') {
|
|
23
|
+
this.new({
|
|
24
|
+
kind: GreaterThanAssertionKind,
|
|
25
|
+
value: valueOrInit,
|
|
26
|
+
equal,
|
|
27
|
+
enabled: true,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
new(init) {
|
|
32
|
+
super.new(init);
|
|
33
|
+
this.kind = GreaterThanAssertionKind;
|
|
34
|
+
this.value = init.value;
|
|
35
|
+
if (typeof init.equal === 'boolean') {
|
|
36
|
+
this.equal = init.equal;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.equal = undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
checkValidity() {
|
|
43
|
+
return typeof this.value === 'number';
|
|
44
|
+
}
|
|
45
|
+
toJSON() {
|
|
46
|
+
const result = {
|
|
47
|
+
...super.toJSON(),
|
|
48
|
+
kind: GreaterThanAssertionKind,
|
|
49
|
+
};
|
|
50
|
+
if (typeof this.value === 'number') {
|
|
51
|
+
result.value = this.value;
|
|
52
|
+
}
|
|
53
|
+
if (typeof this.equal === 'boolean') {
|
|
54
|
+
result.equal = this.equal;
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=GreaterThanAssertion.js.map
|