@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
|
@@ -4,7 +4,8 @@ import { IRequestConfig } from '../../models/RequestConfig.js';
|
|
|
4
4
|
import { IRequestAuthorization } from '../../models/RequestAuthorization.js';
|
|
5
5
|
import { IRequestLog } from '../../models/RequestLog.js';
|
|
6
6
|
import { VariablesProcessor } from '../variables/VariablesProcessor.js';
|
|
7
|
-
import {
|
|
7
|
+
import { IHttpFlow } from '../../models/http-actions/HttpFlows.js';
|
|
8
|
+
import { AssertionResult, IHttpAssertion } from '../../models/http-actions/HttpAssertion.js';
|
|
8
9
|
import { HttpEngineOptions } from '../http-engine/HttpEngine.js';
|
|
9
10
|
import { CoreEngine } from '../http-engine/CoreEngine.js';
|
|
10
11
|
import { Logger } from '../../lib/logging/Logger.js';
|
|
@@ -16,6 +17,7 @@ import { ISentRequest } from "../../models/SentRequest.js";
|
|
|
16
17
|
import { IResponse } from "../../models/Response.js";
|
|
17
18
|
import { IErrorResponse } from "../../models/ErrorResponse.js";
|
|
18
19
|
import { HttpCertificate } from '../../models/ClientCertificate.js';
|
|
20
|
+
import { HttpAssertionRunner } from './HttpAssertionRunner.js';
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* A class that takes a single HttpRequest definition and executes it.
|
|
@@ -45,7 +47,7 @@ export class HttpRequestRunner {
|
|
|
45
47
|
/**
|
|
46
48
|
* Actions to be performed when the request is executed.
|
|
47
49
|
*/
|
|
48
|
-
flows?:
|
|
50
|
+
flows?: IHttpFlow[];
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
53
|
* The cumulative list of all variables to be applied to the request and other properties.
|
|
@@ -80,6 +82,8 @@ export class HttpRequestRunner {
|
|
|
80
82
|
*/
|
|
81
83
|
certificates?: HttpCertificate[]
|
|
82
84
|
|
|
85
|
+
assertions?: IHttpAssertion[];
|
|
86
|
+
|
|
83
87
|
/**
|
|
84
88
|
* Creates an instance from the IRequest object with setting the corresponding variables.
|
|
85
89
|
* @param request The request object to use.
|
|
@@ -89,6 +93,7 @@ export class HttpRequestRunner {
|
|
|
89
93
|
instance.flows = request.flows;
|
|
90
94
|
instance.authorization = request.authorization;
|
|
91
95
|
instance.config = request.config;
|
|
96
|
+
instance.assertions = request.assertions;
|
|
92
97
|
return instance;
|
|
93
98
|
}
|
|
94
99
|
|
|
@@ -215,8 +220,8 @@ export class HttpRequestRunner {
|
|
|
215
220
|
*
|
|
216
221
|
* @param trigger The trigger name to read the flows for.
|
|
217
222
|
*/
|
|
218
|
-
protected async readFlows(trigger: 'request' | 'response'): Promise<
|
|
219
|
-
const result:
|
|
223
|
+
protected async readFlows(trigger: 'request' | 'response'): Promise<IHttpFlow[]> {
|
|
224
|
+
const result: IHttpFlow[] = [];
|
|
220
225
|
const { flows, variables = {}, variablesProcessor } = this;
|
|
221
226
|
if (!Array.isArray(flows) || !flows.length) {
|
|
222
227
|
return result;
|
|
@@ -228,7 +233,7 @@ export class HttpRequestRunner {
|
|
|
228
233
|
if (!Array.isArray(flow.actions) || !flow.actions.length) {
|
|
229
234
|
continue;
|
|
230
235
|
}
|
|
231
|
-
const copy = { ...flow } as
|
|
236
|
+
const copy = { ...flow } as IHttpFlow;
|
|
232
237
|
const actions = copy.actions.map(async (action) => {
|
|
233
238
|
const actionCopy = { ...action };
|
|
234
239
|
if (actionCopy.condition) {
|
|
@@ -339,6 +344,10 @@ export class HttpRequestRunner {
|
|
|
339
344
|
}
|
|
340
345
|
}
|
|
341
346
|
await this.runResponseFlows(request, response);
|
|
347
|
+
const assertions = await this.runAssertions(request, response);
|
|
348
|
+
if (assertions) {
|
|
349
|
+
log.assertions = assertions;
|
|
350
|
+
}
|
|
342
351
|
}
|
|
343
352
|
|
|
344
353
|
get sessionCookies(): boolean {
|
|
@@ -369,4 +378,43 @@ export class HttpRequestRunner {
|
|
|
369
378
|
}
|
|
370
379
|
return `${baseUri}/${currentUrl}`;
|
|
371
380
|
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Prepares and runs assertions on the response.
|
|
384
|
+
* It changes the response object by setting the assertions result.
|
|
385
|
+
*/
|
|
386
|
+
async runAssertions(request: ISentRequest, response: IResponse | IErrorResponse): Promise<AssertionResult[] | undefined> {
|
|
387
|
+
const assertions = await this.readAssertions();
|
|
388
|
+
if (!assertions.length) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
const factory = new HttpAssertionRunner();
|
|
392
|
+
return factory.run(request, response, assertions);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @returns Prepared (evaluated with variables) assertions. Only not disabled assertions are returned.
|
|
397
|
+
*/
|
|
398
|
+
protected async readAssertions(): Promise<IHttpAssertion[]> {
|
|
399
|
+
const { assertions, variablesProcessor, variables = {} } = this;
|
|
400
|
+
if (!Array.isArray(assertions) || !assertions.length) {
|
|
401
|
+
return [];
|
|
402
|
+
}
|
|
403
|
+
const result: IHttpAssertion[] = [];
|
|
404
|
+
for (const assertion of assertions) {
|
|
405
|
+
if (assertion.enabled === false) {
|
|
406
|
+
continue;
|
|
407
|
+
}
|
|
408
|
+
if (!Array.isArray(assertion.steps) || !assertion.steps.length) {
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
const copy = { ...assertion } as IHttpAssertion;
|
|
412
|
+
const stepsPromises = copy.steps.map(async (step) => {
|
|
413
|
+
return variablesProcessor.evaluateVariablesWithContext(step, variables);
|
|
414
|
+
});
|
|
415
|
+
copy.steps = await Promise.all(stepsPromises);
|
|
416
|
+
result.push(copy);
|
|
417
|
+
}
|
|
418
|
+
return result;
|
|
419
|
+
}
|
|
372
420
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { IProjectExecutionIteration, IProjectExecutionLog } from '
|
|
2
|
+
import { IProjectExecutionIteration, IProjectExecutionLog } from '../../models/ProjectExecution.js';
|
|
3
3
|
|
|
4
4
|
export abstract class BaseRunner extends EventEmitter {
|
|
5
5
|
/**
|
|
@@ -3,7 +3,7 @@ import { cpus } from 'os';
|
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { HttpProject } from '../../models/HttpProject.js';
|
|
6
|
-
import { IProjectExecutionLog, IProjectExecutionIteration } from '
|
|
6
|
+
import { IProjectExecutionLog, IProjectExecutionIteration } from '../../models/ProjectExecution.js';
|
|
7
7
|
import { BaseRunner } from './BaseRunner.js';
|
|
8
8
|
import { State } from './enums.js';
|
|
9
9
|
import { IProjectParallelRunnerOptions, IProjectParallelWorkerOptions } from './InteropInterfaces.js'
|
|
@@ -33,7 +33,7 @@ export interface IWorkerInfo {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
interface WorkerInfoInternal extends IWorkerInfo {
|
|
36
|
-
worker
|
|
36
|
+
worker?: Worker;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export interface IWorkerMessage {
|
|
@@ -133,7 +133,7 @@ export class ProjectParallelRunner extends BaseRunner {
|
|
|
133
133
|
workers.forEach((info) => {
|
|
134
134
|
if (info.status !== 'error') {
|
|
135
135
|
try {
|
|
136
|
-
info.worker
|
|
136
|
+
info.worker?.destroy();
|
|
137
137
|
} catch (e) {
|
|
138
138
|
// ...
|
|
139
139
|
}
|
|
@@ -185,7 +185,7 @@ export class ProjectParallelRunner extends BaseRunner {
|
|
|
185
185
|
const { workers } = this;
|
|
186
186
|
const result: IWorkerInfo[] = [];
|
|
187
187
|
workers.forEach((info) => {
|
|
188
|
-
const cp = { ...info }
|
|
188
|
+
const cp = { ...info };
|
|
189
189
|
delete cp.worker;
|
|
190
190
|
result.push(cp);
|
|
191
191
|
});
|
|
@@ -266,7 +266,7 @@ export class ProjectParallelRunner extends BaseRunner {
|
|
|
266
266
|
const opts: IProjectParallelWorkerOptions = { ...this.options, project: this.project.toJSON() };
|
|
267
267
|
opts.iterations = info.iterations;
|
|
268
268
|
info.status = 'running';
|
|
269
|
-
info.worker
|
|
269
|
+
info.worker?.send({
|
|
270
270
|
cmd: 'run',
|
|
271
271
|
data: opts,
|
|
272
272
|
});
|
|
@@ -229,12 +229,16 @@ export class ProjectRequestRunner extends EventEmitter {
|
|
|
229
229
|
const config = request.getConfig();
|
|
230
230
|
const factory = new HttpRequestRunner();
|
|
231
231
|
factory.variables = variables;
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
const auth = request.readAuthorization();
|
|
233
|
+
if (auth.length) {
|
|
234
|
+
factory.authorization = auth.map(i => i.toJSON());
|
|
234
235
|
}
|
|
235
236
|
if (request.flows) {
|
|
236
237
|
factory.flows = request.flows;
|
|
237
238
|
}
|
|
239
|
+
if (request.assertions) {
|
|
240
|
+
factory.assertions = request.assertions;
|
|
241
|
+
}
|
|
238
242
|
if (request.clientCertificate) {
|
|
239
243
|
factory.certificates = [request.clientCertificate.toJSON()];
|
|
240
244
|
}
|
|
@@ -6,7 +6,7 @@ import { DummyLogger } from '../../lib/logging/DummyLogger.js';
|
|
|
6
6
|
import { IRequestLog } from '../../models/RequestLog.js';
|
|
7
7
|
import { IHttpRequest } from '../../models/HttpRequest.js';
|
|
8
8
|
import { ProjectRequestRunner } from './ProjectRequestRunner.js';
|
|
9
|
-
import { IProjectExecutionIteration, IProjectExecutionLog } from '
|
|
9
|
+
import { IProjectExecutionIteration, IProjectExecutionLog } from '../../models/ProjectExecution.js';
|
|
10
10
|
import { pathExists, readJson } from '../../lib/fs/Fs.js';
|
|
11
11
|
import { BaseRunner } from './BaseRunner.js';
|
|
12
12
|
import { IProjectRunnerOptions, IRequestRunnerOptions } from './InteropInterfaces.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import process from 'process';
|
|
4
4
|
import cluster from 'cluster';
|
|
5
5
|
import { HttpProject, Kind as HttpProjectKind } from '../../models/HttpProject.js';
|
|
6
|
-
import { IProjectExecutionLog } from '
|
|
6
|
+
import { IProjectExecutionLog } from '../../models/ProjectExecution.js';
|
|
7
7
|
import { IWorkerMessage } from './ProjectParallelRunner.js';
|
|
8
8
|
import { IProjectParallelWorkerOptions } from './InteropInterfaces.js';
|
|
9
9
|
import { sleep } from '../../lib/timers/Timers.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SerializableError } from '../../models/SerializableError.js';
|
|
2
2
|
import { sleep } from '../../lib/timers/Timers.js';
|
|
3
3
|
import { ProjectRunner } from './ProjectRunner.js';
|
|
4
|
-
import { IProjectExecutionLog } from '
|
|
4
|
+
import { IProjectExecutionLog } from '../../models/ProjectExecution.js';
|
|
5
5
|
import { State } from './enums.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,41 +1,7 @@
|
|
|
1
1
|
import { IRequestLog } from '../../models/RequestLog.js';
|
|
2
2
|
import { IResponse } from '../../models/Response.js';
|
|
3
3
|
import { ErrorResponse } from '../../models/ErrorResponse.js';
|
|
4
|
-
|
|
5
|
-
export interface IProjectExecutionIteration {
|
|
6
|
-
/**
|
|
7
|
-
* The index of the iteration.
|
|
8
|
-
*/
|
|
9
|
-
index: number;
|
|
10
|
-
/**
|
|
11
|
-
* The list of requests executed in the iteration.
|
|
12
|
-
*/
|
|
13
|
-
executed: IRequestLog[];
|
|
14
|
-
/**
|
|
15
|
-
* The variables evaluated during the run.
|
|
16
|
-
* These variables have values set by requests' HTTP flows.
|
|
17
|
-
*/
|
|
18
|
-
variables: Record<string, string>;
|
|
19
|
-
/**
|
|
20
|
-
* Optional general error message.
|
|
21
|
-
*/
|
|
22
|
-
error?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface IProjectExecutionLog {
|
|
26
|
-
/**
|
|
27
|
-
* The timestamp when the execution started
|
|
28
|
-
*/
|
|
29
|
-
started: number;
|
|
30
|
-
/**
|
|
31
|
-
* The timestamp when the execution ended
|
|
32
|
-
*/
|
|
33
|
-
ended: number;
|
|
34
|
-
/**
|
|
35
|
-
* The execution logs for each iteration.
|
|
36
|
-
*/
|
|
37
|
-
iterations: IProjectExecutionIteration[];
|
|
38
|
-
}
|
|
4
|
+
import { IProjectExecutionLog } from '../../models/ProjectExecution.js';
|
|
39
5
|
|
|
40
6
|
/**
|
|
41
7
|
* Base class for project execution reporters.
|
|
@@ -2,6 +2,7 @@ import { Certificates } from "./Certificates.js";
|
|
|
2
2
|
import { Files } from "./Files.js";
|
|
3
3
|
import { History } from "./History.js";
|
|
4
4
|
import { Media } from "./Media.js";
|
|
5
|
+
import { ProjectRuns } from "./ProjectRuns.js";
|
|
5
6
|
import { Revisions } from "./Revisions.js";
|
|
6
7
|
import { Spaces } from "./Spaces.js";
|
|
7
8
|
import { Trash } from "./Trash.js";
|
|
@@ -36,4 +37,6 @@ export interface ApiClientStore {
|
|
|
36
37
|
media: Media;
|
|
37
38
|
|
|
38
39
|
files: Files;
|
|
40
|
+
|
|
41
|
+
projectRuns: ProjectRuns;
|
|
39
42
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ContextChangeRecord, ContextDeleteRecord, ContextListResult, IBulkOperationResult, IProjectExecutionListOptions } from "../../../events/BaseEvents.js";
|
|
2
|
+
import { IProjectExecution } from "../../../models/ProjectExecution.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A store where project execution logs are kept.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProjectRuns {
|
|
8
|
+
/**
|
|
9
|
+
* Adds an execution logs object to the store.
|
|
10
|
+
*
|
|
11
|
+
* @param history The history object
|
|
12
|
+
* @param space The parent space key
|
|
13
|
+
*/
|
|
14
|
+
add(item: IProjectExecution): Promise<ContextChangeRecord<IProjectExecution>>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Reads an execution logs item.
|
|
18
|
+
*
|
|
19
|
+
* @param key The key of the history object to read.
|
|
20
|
+
*/
|
|
21
|
+
read(key: string): Promise<IProjectExecution>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Lists the execution logs data.
|
|
25
|
+
* @param space The parent space key
|
|
26
|
+
* @param options List options
|
|
27
|
+
*/
|
|
28
|
+
list(options?: IProjectExecutionListOptions): Promise<ContextListResult<IProjectExecution>>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Marks the data as deleted.
|
|
32
|
+
*
|
|
33
|
+
* @param key The key of the object to delete.
|
|
34
|
+
*/
|
|
35
|
+
delete(key: string): Promise<ContextDeleteRecord>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Deletes a history in a bulk operation.
|
|
39
|
+
*
|
|
40
|
+
* @param keys The list of history keys to delete.
|
|
41
|
+
*/
|
|
42
|
+
deleteBulk(keys: string[]): Promise<IBulkOperationResult<ContextDeleteRecord>>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Clears the datastore from history for a space.
|
|
46
|
+
*
|
|
47
|
+
* @param space The parent space key
|
|
48
|
+
*/
|
|
49
|
+
clearSpace(space: string): Promise<void>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Clears all history from a project
|
|
53
|
+
*
|
|
54
|
+
* @param project The parent project key
|
|
55
|
+
*/
|
|
56
|
+
clearProject(space: string, project: string): Promise<void>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Clears all history from a folder
|
|
60
|
+
*
|
|
61
|
+
* @param project The parent project key
|
|
62
|
+
*/
|
|
63
|
+
clearParent(space: string, project: string, folder: string): Promise<void>;
|
|
64
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JmesparthReader.js","sourceRoot":"","sources":["../../../src/data/JmesparthReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC9C,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,SAAS,CAAC;SAClB;QACD,IAAI,GAAQ,CAAC;QACb,IAAI;YACF,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { SameSiteValue } from '../../cookies/CookieParser.js';
|
|
2
|
-
export declare const ReadDataStepKind = "HttpAction#ReadData";
|
|
3
|
-
export declare const SetDataStepKind = "HttpAction#SetData";
|
|
4
|
-
export declare const SetVariableStepKind = "HttpAction#SetVariable";
|
|
5
|
-
export declare const SetCookieStepKind = "HttpAction#SetCookie";
|
|
6
|
-
export declare const DeleteCookieStepKind = "HttpAction#DeleteCookie";
|
|
7
|
-
export declare enum ActionSourceEnum {
|
|
8
|
-
/**
|
|
9
|
-
* The request object.
|
|
10
|
-
*/
|
|
11
|
-
request = "request",
|
|
12
|
-
/**
|
|
13
|
-
* The response object.
|
|
14
|
-
*/
|
|
15
|
-
response = "response",
|
|
16
|
-
/**
|
|
17
|
-
* A variable from the current environment.
|
|
18
|
-
*/
|
|
19
|
-
variable = "variable"
|
|
20
|
-
}
|
|
21
|
-
export declare enum ActionOperatorEnum {
|
|
22
|
-
equal = "equal",
|
|
23
|
-
notEqual = "not-equal",
|
|
24
|
-
greaterThan = "greater-than",
|
|
25
|
-
greaterThanEqual = "greater-than-equal",
|
|
26
|
-
lessThan = "less-than",
|
|
27
|
-
lessThanEqual = "less-than-equal",
|
|
28
|
-
contains = "contains",
|
|
29
|
-
regex = "regex"
|
|
30
|
-
}
|
|
31
|
-
export declare enum ActionRequestDataEnum {
|
|
32
|
-
url = "url",
|
|
33
|
-
method = "method",
|
|
34
|
-
headers = "headers",
|
|
35
|
-
body = "body"
|
|
36
|
-
}
|
|
37
|
-
export declare enum ActionResponseDataEnum {
|
|
38
|
-
url = "url",
|
|
39
|
-
status = "status",
|
|
40
|
-
headers = "headers",
|
|
41
|
-
body = "body"
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* A flow represents a series of actions to be performed one-by-one after the HTTP request is sent or when the response
|
|
45
|
-
* is ready.
|
|
46
|
-
*/
|
|
47
|
-
export interface IHttpActionFlow {
|
|
48
|
-
/**
|
|
49
|
-
* The description of the flow
|
|
50
|
-
*/
|
|
51
|
-
description?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Describes when the flow is executed.
|
|
54
|
-
* The `request` means the flow is executed before the request is sent to the HTTP engine.
|
|
55
|
-
* The `response` means the flow is executed after the response has been received in full, but before reporting
|
|
56
|
-
* the response to the UI.
|
|
57
|
-
*/
|
|
58
|
-
trigger: 'request' | 'response';
|
|
59
|
-
/**
|
|
60
|
-
* The ordered list of actions to execute.
|
|
61
|
-
*/
|
|
62
|
-
actions: IHttpAction[];
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Describes a single action in a flow.
|
|
66
|
-
* An action can have a condition that is checked against the current context.
|
|
67
|
-
* Action is not executed when the condition is not meet.
|
|
68
|
-
*
|
|
69
|
-
* Each action has one or more steps (when 0 items then the action is ignored). Each step performs a task.
|
|
70
|
-
* 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`.
|
|
71
|
-
*/
|
|
72
|
-
export interface IHttpAction {
|
|
73
|
-
/**
|
|
74
|
-
* The description of the action
|
|
75
|
-
*/
|
|
76
|
-
description?: string;
|
|
77
|
-
/**
|
|
78
|
-
* A condition to check before performing the action.
|
|
79
|
-
*/
|
|
80
|
-
condition?: IHttpCondition;
|
|
81
|
-
/**
|
|
82
|
-
* The list of steps to perform. This is an ordered list of action tasks.
|
|
83
|
-
* Each step is described by the `kind` property which tells the runner what action to perform.
|
|
84
|
-
*/
|
|
85
|
-
steps: IActionStep[];
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* A condition to execute for an action.
|
|
89
|
-
*/
|
|
90
|
-
export interface IHttpCondition {
|
|
91
|
-
/**
|
|
92
|
-
* The main data source.
|
|
93
|
-
* In the legacy actions this was `type`.
|
|
94
|
-
*/
|
|
95
|
-
source?: ActionSourceEnum;
|
|
96
|
-
/**
|
|
97
|
-
* Source of the data.
|
|
98
|
-
* In the legacy actions this was `source`.
|
|
99
|
-
* This is not required when the source is not `request` or `response`.
|
|
100
|
-
*/
|
|
101
|
-
data?: ActionRequestDataEnum | ActionResponseDataEnum;
|
|
102
|
-
/**
|
|
103
|
-
* The path to the data.
|
|
104
|
-
* For JSON value use https://jmespath.org/ syntax.
|
|
105
|
-
* For XML use xpath.
|
|
106
|
-
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
107
|
-
*/
|
|
108
|
-
path?: string;
|
|
109
|
-
/**
|
|
110
|
-
* The comparison operator.
|
|
111
|
-
*/
|
|
112
|
-
operator?: ActionOperatorEnum;
|
|
113
|
-
/**
|
|
114
|
-
* The value to compare the read result.
|
|
115
|
-
* In runtime, the type is casted to the same type as read value.
|
|
116
|
-
*
|
|
117
|
-
* When this is not set it compares to an empty string value or `0`.
|
|
118
|
-
*
|
|
119
|
-
* In ARC actions this was the `predictedValue`.
|
|
120
|
-
*/
|
|
121
|
-
value?: string;
|
|
122
|
-
}
|
|
123
|
-
export interface IActionStep {
|
|
124
|
-
/**
|
|
125
|
-
* The kind of the action to perform.
|
|
126
|
-
*/
|
|
127
|
-
kind: string;
|
|
128
|
-
/**
|
|
129
|
-
* Whether the step is disabled in the flow.
|
|
130
|
-
*/
|
|
131
|
-
enabled?: boolean;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Reads the data from various sources.
|
|
135
|
-
*/
|
|
136
|
-
export interface IReadDataStep extends IActionStep {
|
|
137
|
-
kind: typeof ReadDataStepKind;
|
|
138
|
-
/**
|
|
139
|
-
* The main data source.
|
|
140
|
-
* In the legacy actions this was `type`.
|
|
141
|
-
*/
|
|
142
|
-
source?: ActionSourceEnum;
|
|
143
|
-
/**
|
|
144
|
-
* Source of the data.
|
|
145
|
-
* In the legacy actions this was `source`.
|
|
146
|
-
* This is not required when the source is not `request` or `response`.
|
|
147
|
-
*/
|
|
148
|
-
data?: ActionRequestDataEnum | ActionResponseDataEnum;
|
|
149
|
-
/**
|
|
150
|
-
* The path to the data.
|
|
151
|
-
* For JSON value use https://jmespath.org/ syntax.
|
|
152
|
-
* For XML use xpath.
|
|
153
|
-
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
154
|
-
*/
|
|
155
|
-
path?: string;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Sets a manually defined value that can be passed to the next step.
|
|
159
|
-
*/
|
|
160
|
-
export interface ISetDataStep extends IActionStep {
|
|
161
|
-
kind: typeof SetDataStepKind;
|
|
162
|
-
/**
|
|
163
|
-
* The value to return to the next step.
|
|
164
|
-
* This is always a string. Use the `dataType` to determine the correct data type.
|
|
165
|
-
*/
|
|
166
|
-
value: string;
|
|
167
|
-
/**
|
|
168
|
-
* The data type of the value. This is a value prefixed with
|
|
169
|
-
* `http://www.w3.org/2001/XMLSchema#` or `http://a.ml/vocabularies/shapes#`.
|
|
170
|
-
*
|
|
171
|
-
* Examples:
|
|
172
|
-
*
|
|
173
|
-
* - `http://www.w3.org/2001/XMLSchema#boolean`
|
|
174
|
-
* - `http://www.w3.org/2001/XMLSchema#string`
|
|
175
|
-
* - `http://www.w3.org/2001/XMLSchema#number`
|
|
176
|
-
* - `http://www.w3.org/2001/XMLSchema#integer`
|
|
177
|
-
* - `http://www.w3.org/2001/XMLSchema#long`
|
|
178
|
-
* - `http://a.ml/vocabularies/shapes#number`
|
|
179
|
-
* - `http://a.ml/vocabularies/shapes#integer`
|
|
180
|
-
* - `http://a.ml/vocabularies/shapes#double`
|
|
181
|
-
* - ...
|
|
182
|
-
*
|
|
183
|
-
* @default `http://www.w3.org/2001/XMLSchema#string`
|
|
184
|
-
*/
|
|
185
|
-
dataType?: string;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* A step that accepts an input from the previous step and sets a variable in the current environment
|
|
189
|
-
* with this value. If the value is `void`, `null`, or `undefined` then the variable is removed from the
|
|
190
|
-
* environment.
|
|
191
|
-
*
|
|
192
|
-
* All variables are strings.
|
|
193
|
-
*/
|
|
194
|
-
export interface ISetVariableStep extends IActionStep {
|
|
195
|
-
kind: typeof SetVariableStepKind;
|
|
196
|
-
/**
|
|
197
|
-
* The name of the variable to set
|
|
198
|
-
*/
|
|
199
|
-
name: string;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* A step that allows to set a cookie with the value returned by a previous step.
|
|
203
|
-
*/
|
|
204
|
-
export interface ISetCookieStep extends IActionStep {
|
|
205
|
-
kind: typeof SetCookieStepKind;
|
|
206
|
-
/**
|
|
207
|
-
* Name of the cookie
|
|
208
|
-
*/
|
|
209
|
-
name: string;
|
|
210
|
-
/**
|
|
211
|
-
* The URL associated with the cookie. When not set it uses the request URL or the request URL of the last redirect.
|
|
212
|
-
*/
|
|
213
|
-
url?: string;
|
|
214
|
-
/**
|
|
215
|
-
* The cookie expiration time. It can be a valid cookie date or a string representing a relative time to "now"
|
|
216
|
-
* like `4d`, `600s`, etc.
|
|
217
|
-
*/
|
|
218
|
-
expires?: string;
|
|
219
|
-
/**
|
|
220
|
-
* Whether the cookie is host only
|
|
221
|
-
*/
|
|
222
|
-
hostOnly?: boolean;
|
|
223
|
-
/**
|
|
224
|
-
* Whether the cookie is HTTP only
|
|
225
|
-
*/
|
|
226
|
-
httpOnly?: boolean;
|
|
227
|
-
/**
|
|
228
|
-
* Whether the cookie is HTTPS only
|
|
229
|
-
*/
|
|
230
|
-
secure?: boolean;
|
|
231
|
-
/**
|
|
232
|
-
* Whether the cookie is a session cookie
|
|
233
|
-
*/
|
|
234
|
-
session?: boolean;
|
|
235
|
-
/**
|
|
236
|
-
* The SameSite parameter of the cookie.
|
|
237
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#creating_cookies
|
|
238
|
-
*/
|
|
239
|
-
sameSite?: SameSiteValue;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* A step allowing to delete a cookie for the given configuration.
|
|
243
|
-
* This step does not require an input.
|
|
244
|
-
*/
|
|
245
|
-
export interface IDeleteCookieStep extends IActionStep {
|
|
246
|
-
kind: typeof DeleteCookieStepKind;
|
|
247
|
-
/**
|
|
248
|
-
* The URL associated with the cookie. When not set it uses the request URL or the request URL of the last redirect.
|
|
249
|
-
*/
|
|
250
|
-
url?: string;
|
|
251
|
-
/**
|
|
252
|
-
* Name of the cookie to remove.
|
|
253
|
-
* When not set it removes all cookies for the URL.
|
|
254
|
-
*/
|
|
255
|
-
name?: string;
|
|
256
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export const ReadDataStepKind = 'HttpAction#ReadData';
|
|
2
|
-
export const SetDataStepKind = 'HttpAction#SetData';
|
|
3
|
-
export const SetVariableStepKind = 'HttpAction#SetVariable';
|
|
4
|
-
export const SetCookieStepKind = 'HttpAction#SetCookie';
|
|
5
|
-
export const DeleteCookieStepKind = 'HttpAction#DeleteCookie';
|
|
6
|
-
export var ActionSourceEnum;
|
|
7
|
-
(function (ActionSourceEnum) {
|
|
8
|
-
/**
|
|
9
|
-
* The request object.
|
|
10
|
-
*/
|
|
11
|
-
ActionSourceEnum["request"] = "request";
|
|
12
|
-
/**
|
|
13
|
-
* The response object.
|
|
14
|
-
*/
|
|
15
|
-
ActionSourceEnum["response"] = "response";
|
|
16
|
-
/**
|
|
17
|
-
* A variable from the current environment.
|
|
18
|
-
*/
|
|
19
|
-
ActionSourceEnum["variable"] = "variable";
|
|
20
|
-
})(ActionSourceEnum || (ActionSourceEnum = {}));
|
|
21
|
-
export var ActionOperatorEnum;
|
|
22
|
-
(function (ActionOperatorEnum) {
|
|
23
|
-
ActionOperatorEnum["equal"] = "equal";
|
|
24
|
-
ActionOperatorEnum["notEqual"] = "not-equal";
|
|
25
|
-
ActionOperatorEnum["greaterThan"] = "greater-than";
|
|
26
|
-
ActionOperatorEnum["greaterThanEqual"] = "greater-than-equal";
|
|
27
|
-
ActionOperatorEnum["lessThan"] = "less-than";
|
|
28
|
-
ActionOperatorEnum["lessThanEqual"] = "less-than-equal";
|
|
29
|
-
ActionOperatorEnum["contains"] = "contains";
|
|
30
|
-
ActionOperatorEnum["regex"] = "regex";
|
|
31
|
-
})(ActionOperatorEnum || (ActionOperatorEnum = {}));
|
|
32
|
-
export var ActionRequestDataEnum;
|
|
33
|
-
(function (ActionRequestDataEnum) {
|
|
34
|
-
ActionRequestDataEnum["url"] = "url";
|
|
35
|
-
ActionRequestDataEnum["method"] = "method";
|
|
36
|
-
ActionRequestDataEnum["headers"] = "headers";
|
|
37
|
-
ActionRequestDataEnum["body"] = "body";
|
|
38
|
-
})(ActionRequestDataEnum || (ActionRequestDataEnum = {}));
|
|
39
|
-
export var ActionResponseDataEnum;
|
|
40
|
-
(function (ActionResponseDataEnum) {
|
|
41
|
-
ActionResponseDataEnum["url"] = "url";
|
|
42
|
-
ActionResponseDataEnum["status"] = "status";
|
|
43
|
-
ActionResponseDataEnum["headers"] = "headers";
|
|
44
|
-
ActionResponseDataEnum["body"] = "body";
|
|
45
|
-
})(ActionResponseDataEnum || (ActionResponseDataEnum = {}));
|
|
46
|
-
//# sourceMappingURL=HttpActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpActions.js","sourceRoot":"","sources":["../../../../src/models/http-actions/HttpActions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AAC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AACxD,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAE9D,MAAM,CAAN,IAAY,gBAaX;AAbD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,uCAAmB,CAAA;IACnB;;OAEG;IACH,yCAAqB,CAAA;IACrB;;OAEG;IACH,yCAAqB,CAAA;AACvB,CAAC,EAbW,gBAAgB,KAAhB,gBAAgB,QAa3B;AAED,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,4CAAsB,CAAA;IACtB,kDAA4B,CAAA;IAC5B,6DAAuC,CAAA;IACvC,4CAAsB,CAAA;IACtB,uDAAiC,CAAA;IACjC,2CAAqB,CAAA;IACrB,qCAAe,CAAA;AACjB,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,sCAAa,CAAA;AACf,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,6CAAmB,CAAA;IACnB,uCAAa,CAAA;AACf,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC"}
|