@pact-foundation/pact 16.3.1 → 16.5.0
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/CHANGELOG.md +23 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +22 -12
- package/package.json +26 -47
- package/scripts/ci/build-and-test.sh +0 -3
- package/scripts/install-plugins.js +104 -0
- package/src/common/graphQL/configurationError.js +2 -22
- package/src/common/graphQL/configurationError.js.map +1 -1
- package/src/common/graphQL/graphQL.d.ts +2 -2
- package/src/common/graphQL/graphQL.js +11 -14
- package/src/common/graphQL/graphQL.js.map +1 -1
- package/src/common/graphQL/graphQLQueryError.js +2 -22
- package/src/common/graphQL/graphQLQueryError.js.map +1 -1
- package/src/common/logger.js +9 -9
- package/src/common/logger.js.map +1 -1
- package/src/common/matchingRules.d.ts +7 -1
- package/src/common/matchingRules.js +42 -22
- package/src/common/matchingRules.js.map +1 -1
- package/src/common/net.js +36 -42
- package/src/common/net.js.map +1 -1
- package/src/common/net.spec.js +39 -87
- package/src/common/net.spec.js.map +1 -1
- package/src/common/request.js +33 -82
- package/src/common/request.js.map +1 -1
- package/src/common/request.spec.js +29 -73
- package/src/common/request.spec.js.map +1 -1
- package/src/common/spec.js +3 -4
- package/src/common/spec.js.map +1 -1
- package/src/dsl/apolloGraphql.js +7 -25
- package/src/dsl/apolloGraphql.js.map +1 -1
- package/src/dsl/apolloGraphql.spec.js +21 -58
- package/src/dsl/apolloGraphql.spec.js.map +1 -1
- package/src/dsl/graphql.d.ts +2 -2
- package/src/dsl/graphql.js +29 -48
- package/src/dsl/graphql.js.map +1 -1
- package/src/dsl/graphql.spec.js +92 -117
- package/src/dsl/graphql.spec.js.map +1 -1
- package/src/dsl/interaction.d.ts +2 -2
- package/src/dsl/interaction.js +41 -48
- package/src/dsl/interaction.js.map +1 -1
- package/src/dsl/interaction.spec.js +109 -132
- package/src/dsl/interaction.spec.js.map +1 -1
- package/src/dsl/matchers.d.ts +2 -3
- package/src/dsl/matchers.js +19 -31
- package/src/dsl/matchers.js.map +1 -1
- package/src/dsl/matchers.spec.js +279 -289
- package/src/dsl/matchers.spec.js.map +1 -1
- package/src/dsl/message.d.ts +3 -3
- package/src/dsl/options.d.ts +3 -3
- package/src/dsl/verifier/proxy/hooks.d.ts +2 -2
- package/src/dsl/verifier/proxy/hooks.js +42 -112
- package/src/dsl/verifier/proxy/hooks.js.map +1 -1
- package/src/dsl/verifier/proxy/hooks.spec.js +86 -199
- package/src/dsl/verifier/proxy/hooks.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/messages.d.ts +2 -2
- package/src/dsl/verifier/proxy/messages.js +88 -106
- package/src/dsl/verifier/proxy/messages.js.map +1 -1
- package/src/dsl/verifier/proxy/parseBody.d.ts +1 -1
- package/src/dsl/verifier/proxy/parseBody.js +3 -3
- package/src/dsl/verifier/proxy/parseBody.js.map +1 -1
- package/src/dsl/verifier/proxy/parseBody.spec.js +35 -113
- package/src/dsl/verifier/proxy/parseBody.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/proxy.d.ts +2 -2
- package/src/dsl/verifier/proxy/proxy.js +22 -26
- package/src/dsl/verifier/proxy/proxy.js.map +1 -1
- package/src/dsl/verifier/proxy/proxy.spec.js +11 -53
- package/src/dsl/verifier/proxy/proxy.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/proxyRequest.d.ts +3 -3
- package/src/dsl/verifier/proxy/proxyRequest.js +7 -7
- package/src/dsl/verifier/proxy/proxyRequest.js.map +1 -1
- package/src/dsl/verifier/proxy/proxyRequest.spec.js +54 -104
- package/src/dsl/verifier/proxy/proxyRequest.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/setupStates.d.ts +3 -3
- package/src/dsl/verifier/proxy/stateHandler/setupStates.js +14 -18
- package/src/dsl/verifier/proxy/stateHandler/setupStates.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/setupStates.spec.js +76 -193
- package/src/dsl/verifier/proxy/stateHandler/setupStates.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.d.ts +2 -2
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.js +23 -72
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.spec.js +37 -122
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/tracer.d.ts +1 -1
- package/src/dsl/verifier/proxy/tracer.js +42 -35
- package/src/dsl/verifier/proxy/tracer.js.map +1 -1
- package/src/dsl/verifier/proxy/types.d.ts +5 -5
- package/src/dsl/verifier/types.d.ts +3 -3
- package/src/dsl/verifier/verifier.d.ts +5 -1
- package/src/dsl/verifier/verifier.js +53 -60
- package/src/dsl/verifier/verifier.js.map +1 -1
- package/src/dsl/verifier/verifier.spec.js +84 -151
- package/src/dsl/verifier/verifier.spec.js.map +1 -1
- package/src/errors/configurationError.js +2 -22
- package/src/errors/configurationError.js.map +1 -1
- package/src/errors/graphQLQueryError.js +2 -22
- package/src/errors/graphQLQueryError.js.map +1 -1
- package/src/errors/matcherError.js +2 -22
- package/src/errors/matcherError.js.map +1 -1
- package/src/errors/verificationError.js +2 -22
- package/src/errors/verificationError.js.map +1 -1
- package/src/httpPact/ffi.d.ts +2 -2
- package/src/httpPact/ffi.js +28 -29
- package/src/httpPact/ffi.js.map +1 -1
- package/src/httpPact/ffi.spec.js +40 -83
- package/src/httpPact/ffi.spec.js.map +1 -1
- package/src/httpPact/index.d.ts +3 -3
- package/src/httpPact/index.js +92 -149
- package/src/httpPact/index.js.map +1 -1
- package/src/httpPact/index.spec.js +102 -195
- package/src/httpPact/index.spec.js.map +1 -1
- package/src/httpPact/tracing.js +20 -28
- package/src/httpPact/tracing.js.map +1 -1
- package/src/index.d.ts +25 -25
- package/src/index.js +29 -29
- package/src/index.js.map +1 -1
- package/src/messageConsumerPact.d.ts +5 -5
- package/src/messageConsumerPact.js +59 -53
- package/src/messageConsumerPact.js.map +1 -1
- package/src/messageConsumerPact.spec.js +55 -97
- package/src/messageConsumerPact.spec.js.map +1 -1
- package/src/messageProviderPact.d.ts +3 -3
- package/src/messageProviderPact.js +68 -85
- package/src/messageProviderPact.js.map +1 -1
- package/src/messageProviderPact.spec.js +96 -123
- package/src/messageProviderPact.spec.js.map +1 -1
- package/src/pact.integration.spec.js +242 -351
- package/src/pact.integration.spec.js.map +1 -1
- package/src/v3/display.d.ts +1 -1
- package/src/v3/display.js +44 -58
- package/src/v3/display.js.map +1 -1
- package/src/v3/ffi.js +20 -16
- package/src/v3/ffi.js.map +1 -1
- package/src/v3/ffi.spec.js +7 -42
- package/src/v3/ffi.spec.js.map +1 -1
- package/src/v3/graphql/graphQL.d.ts +4 -4
- package/src/v3/graphql/graphQL.js +50 -75
- package/src/v3/graphql/graphQL.js.map +1 -1
- package/src/v3/graphql/index.d.ts +1 -1
- package/src/v3/graphql/index.js +1 -1
- package/src/v3/graphql/index.js.map +1 -1
- package/src/v3/index.d.ts +4 -12
- package/src/v3/index.js +4 -12
- package/src/v3/index.js.map +1 -1
- package/src/v3/matchers.d.ts +15 -3
- package/src/v3/matchers.js +131 -148
- package/src/v3/matchers.js.map +1 -1
- package/src/v3/matchers.spec.js +281 -232
- package/src/v3/matchers.spec.js.map +1 -1
- package/src/v3/pact.d.ts +2 -2
- package/src/v3/pact.js +108 -151
- package/src/v3/pact.js.map +1 -1
- package/src/v3/pact.spec.js +94 -0
- package/src/v3/pact.spec.js.map +1 -0
- package/src/v3/types.d.ts +19 -3
- package/src/v3/types.js +22 -1
- package/src/v3/types.js.map +1 -1
- package/src/v4/graphql/graphQLInteractionWithRequest.d.ts +4 -4
- package/src/v4/graphql/graphQLInteractionWithRequest.js +21 -17
- package/src/v4/graphql/graphQLInteractionWithRequest.js.map +1 -1
- package/src/v4/graphql/graphQLRequestBuilder.d.ts +3 -3
- package/src/v4/graphql/graphQLRequestBuilder.js +18 -20
- package/src/v4/graphql/graphQLRequestBuilder.js.map +1 -1
- package/src/v4/graphql/index.d.ts +6 -6
- package/src/v4/graphql/index.js +21 -17
- package/src/v4/graphql/index.js.map +1 -1
- package/src/v4/graphql/types.d.ts +5 -5
- package/src/v4/http/index.d.ts +2 -2
- package/src/v4/http/index.js +53 -93
- package/src/v4/http/index.js.map +1 -1
- package/src/v4/http/index.spec.d.ts +1 -0
- package/src/v4/http/index.spec.js +73 -0
- package/src/v4/http/index.spec.js.map +1 -0
- package/src/v4/http/interactionWithCompleteRequest.d.ts +4 -7
- package/src/v4/http/interactionWithCompleteRequest.js +6 -10
- package/src/v4/http/interactionWithCompleteRequest.js.map +1 -1
- package/src/v4/http/interactionWithPlugin.d.ts +3 -3
- package/src/v4/http/interactionWithPlugin.js +14 -11
- package/src/v4/http/interactionWithPlugin.js.map +1 -1
- package/src/v4/http/interactionWithPluginRequest.d.ts +4 -3
- package/src/v4/http/interactionWithPluginRequest.js +17 -9
- package/src/v4/http/interactionWithPluginRequest.js.map +1 -1
- package/src/v4/http/interactionWithPluginResponse.d.ts +2 -2
- package/src/v4/http/interactionWithPluginResponse.js +10 -48
- package/src/v4/http/interactionWithPluginResponse.js.map +1 -1
- package/src/v4/http/interactionWithRequest.d.ts +4 -3
- package/src/v4/http/interactionWithRequest.js +17 -9
- package/src/v4/http/interactionWithRequest.js.map +1 -1
- package/src/v4/http/interactionWithRequest.spec.d.ts +1 -0
- package/src/v4/http/interactionWithRequest.spec.js +82 -0
- package/src/v4/http/interactionWithRequest.spec.js.map +1 -0
- package/src/v4/http/interactionWithResponse.d.ts +2 -2
- package/src/v4/http/interactionWithResponse.js +10 -48
- package/src/v4/http/interactionWithResponse.js.map +1 -1
- package/src/v4/http/requestBuilder.d.ts +4 -3
- package/src/v4/http/requestBuilder.js +36 -34
- package/src/v4/http/requestBuilder.js.map +1 -1
- package/src/v4/http/requestBuilder.spec.d.ts +1 -0
- package/src/v4/http/requestBuilder.spec.js +42 -0
- package/src/v4/http/requestBuilder.spec.js.map +1 -0
- package/src/v4/http/requestWithPluginBuilder.d.ts +3 -2
- package/src/v4/http/requestWithPluginBuilder.js +30 -46
- package/src/v4/http/requestWithPluginBuilder.js.map +1 -1
- package/src/v4/http/requestWithPluginBuilder.spec.d.ts +1 -0
- package/src/v4/http/requestWithPluginBuilder.spec.js +34 -0
- package/src/v4/http/requestWithPluginBuilder.spec.js.map +1 -0
- package/src/v4/http/responseBuilder.d.ts +4 -3
- package/src/v4/http/responseBuilder.js +28 -25
- package/src/v4/http/responseBuilder.js.map +1 -1
- package/src/v4/http/responseBuilder.spec.d.ts +1 -0
- package/src/v4/http/responseBuilder.spec.js +42 -0
- package/src/v4/http/responseBuilder.spec.js.map +1 -0
- package/src/v4/http/responseWithPluginBuilder.d.ts +1 -1
- package/src/v4/http/responseWithPluginBuilder.js +5 -25
- package/src/v4/http/responseWithPluginBuilder.js.map +1 -1
- package/src/v4/http/responseWithPluginBuilder.spec.d.ts +1 -0
- package/src/v4/http/responseWithPluginBuilder.spec.js +34 -0
- package/src/v4/http/responseWithPluginBuilder.spec.js.map +1 -0
- package/src/v4/http/types.d.ts +13 -4
- package/src/v4/http/unconfiguredInteraction.d.ts +6 -5
- package/src/v4/http/unconfiguredInteraction.js +31 -26
- package/src/v4/http/unconfiguredInteraction.js.map +1 -1
- package/src/v4/index.d.ts +6 -5
- package/src/v4/index.js +32 -35
- package/src/v4/index.js.map +1 -1
- package/src/v4/message/asynchronousMessage.d.ts +7 -6
- package/src/v4/message/asynchronousMessage.js +157 -190
- package/src/v4/message/asynchronousMessage.js.map +1 -1
- package/src/v4/message/index.d.ts +7 -6
- package/src/v4/message/index.js +188 -217
- package/src/v4/message/index.js.map +1 -1
- package/src/v4/message/types.d.ts +5 -3
- package/src/v4/types.d.ts +3 -3
- package/src/xml/index.d.ts +4 -0
- package/src/xml/index.js +21 -0
- package/src/xml/index.js.map +1 -0
- package/src/{v3/xml → xml}/xmlBuilder.d.ts +1 -3
- package/src/{v3/xml → xml}/xmlBuilder.js +7 -9
- package/src/xml/xmlBuilder.js.map +1 -0
- package/src/{v3/xml → xml}/xmlElement.d.ts +2 -2
- package/src/xml/xmlElement.js +73 -0
- package/src/xml/xmlElement.js.map +1 -0
- package/src/xml/xmlElement.spec.d.ts +1 -0
- package/src/xml/xmlElement.spec.js +107 -0
- package/src/xml/xmlElement.spec.js.map +1 -0
- package/src/xml/xmlNode.js +7 -0
- package/src/xml/xmlNode.js.map +1 -0
- package/src/{v3/xml → xml}/xmlText.d.ts +1 -1
- package/src/xml/xmlText.js +15 -0
- package/src/xml/xmlText.js.map +1 -0
- package/scripts/install-plugins +0 -106
- package/src/v3/xml/xmlBuilder.js.map +0 -1
- package/src/v3/xml/xmlElement.js +0 -90
- package/src/v3/xml/xmlElement.js.map +0 -1
- package/src/v3/xml/xmlElement.spec.js +0 -113
- package/src/v3/xml/xmlElement.spec.js.map +0 -1
- package/src/v3/xml/xmlNode.js +0 -10
- package/src/v3/xml/xmlNode.js.map +0 -1
- package/src/v3/xml/xmlText.js +0 -31
- package/src/v3/xml/xmlText.js.map +0 -1
- /package/src/v3/{xml/xmlElement.spec.d.ts → pact.spec.d.ts} +0 -0
- /package/src/{v3/xml → xml}/xmlNode.d.ts +0 -0
|
@@ -1,52 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RequestBuilder = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const ramda_1 = require("ramda");
|
|
5
|
+
const matchingRules_1 = require("../../common/matchingRules");
|
|
6
|
+
const matchers_1 = require("../../v3/matchers");
|
|
7
|
+
const _1 = require(".");
|
|
8
|
+
class RequestBuilder {
|
|
9
|
+
interaction;
|
|
9
10
|
// tslint:disable:no-empty-function
|
|
10
|
-
|
|
11
|
+
constructor(interaction) {
|
|
11
12
|
this.interaction = interaction;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(0, ramda_1.forEachObjIndexed)(function (v, k) {
|
|
14
|
+
query(query) {
|
|
15
|
+
(0, ramda_1.forEachObjIndexed)((v, k) => {
|
|
16
16
|
if (Array.isArray(v)) {
|
|
17
|
-
v.forEach(
|
|
18
|
-
|
|
17
|
+
v.forEach((vv, i) => {
|
|
18
|
+
this.interaction.withQuery(k, i, (0, matchers_1.matcherValueOrString)(vv));
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
-
|
|
22
|
+
this.interaction.withQuery(k, 0, (0, matchers_1.matcherValueOrString)(v));
|
|
23
23
|
}
|
|
24
24
|
}, query);
|
|
25
25
|
return this;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
(0, ramda_1.forEachObjIndexed)(function (v, k) {
|
|
26
|
+
}
|
|
27
|
+
headers(headers) {
|
|
28
|
+
(0, ramda_1.forEachObjIndexed)((v, k) => {
|
|
30
29
|
if (Array.isArray(v)) {
|
|
31
|
-
v.forEach(
|
|
32
|
-
|
|
30
|
+
v.forEach((header, index) => {
|
|
31
|
+
this.interaction.withRequestHeader(`${k}`, index, (0, matchers_1.matcherValueOrString)(header));
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
34
|
else {
|
|
36
|
-
|
|
35
|
+
this.interaction.withRequestHeader(`${k}`, 0, (0, matchers_1.matcherValueOrString)(v));
|
|
37
36
|
}
|
|
38
37
|
}, headers);
|
|
39
38
|
return this;
|
|
40
|
-
}
|
|
41
|
-
|
|
39
|
+
}
|
|
40
|
+
jsonBody(body) {
|
|
42
41
|
this.interaction.withRequestBody((0, matchers_1.matcherValueOrString)(body), 'application/json');
|
|
43
42
|
return this;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
}
|
|
44
|
+
xmlBody(body) {
|
|
45
|
+
this.interaction.withRequestBody((0, matchers_1.matcherValueOrString)(body), 'application/xml');
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
binaryFile(contentType, file) {
|
|
49
|
+
const body = (0, _1.readBinaryData)(file);
|
|
47
50
|
this.interaction.withRequestBinaryBody(body, contentType);
|
|
48
51
|
return this;
|
|
49
|
-
}
|
|
52
|
+
}
|
|
50
53
|
/**
|
|
51
54
|
* Sets the request body as multipart/form-data content.
|
|
52
55
|
* This is useful for testing APIs that accept file uploads or multipart form submissions.
|
|
@@ -57,10 +60,10 @@ var RequestBuilder = /** @class */ (function () {
|
|
|
57
60
|
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
58
61
|
* @returns The V4RequestBuilder instance for method chaining
|
|
59
62
|
*/
|
|
60
|
-
|
|
63
|
+
multipartBody(contentType, file, mimePartName, boundary) {
|
|
61
64
|
this.interaction.withRequestMultipartBody(contentType, file, mimePartName, boundary);
|
|
62
65
|
return this;
|
|
63
|
-
}
|
|
66
|
+
}
|
|
64
67
|
/**
|
|
65
68
|
* Applies matching rules to the consumer request.
|
|
66
69
|
* Matching rules allow you to define flexible matching criteria for request attributes
|
|
@@ -69,17 +72,16 @@ var RequestBuilder = /** @class */ (function () {
|
|
|
69
72
|
* @param rules - The matching rules as a strongly typed Rules object. Rules should follow the Pact matching rules format.
|
|
70
73
|
* @returns The V4RequestBuilder instance for method chaining
|
|
71
74
|
*/
|
|
72
|
-
|
|
75
|
+
matchingRules(rules) {
|
|
73
76
|
(0, matchingRules_1.validateRules)(rules);
|
|
74
|
-
|
|
77
|
+
const ffiRules = (0, matchingRules_1.convertRulesToFFI)(rules);
|
|
75
78
|
this.interaction.withRequestMatchingRules(JSON.stringify(ffiRules));
|
|
76
79
|
return this;
|
|
77
|
-
}
|
|
78
|
-
|
|
80
|
+
}
|
|
81
|
+
body(contentType, body) {
|
|
79
82
|
this.interaction.withRequestBinaryBody(body, contentType);
|
|
80
83
|
return this;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
}());
|
|
84
|
+
}
|
|
85
|
+
}
|
|
84
86
|
exports.RequestBuilder = RequestBuilder;
|
|
85
87
|
//# sourceMappingURL=requestBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/requestBuilder.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/requestBuilder.ts"],"names":[],"mappings":";;;AACA,iCAA0C;AAC1C,8DAA8E;AAE9E,gDAAyD;AACzD,wBAAmC;AAGnC,MAAa,cAAc;IAEH;IADtB,mCAAmC;IACnC,YAAsB,WAAgC;QAAhC,gBAAW,GAAX,WAAW,CAAqB;IAAG,CAAC;IAE1D,KAAK,CAAC,KAAoB;QACxB,IAAA,yBAAiB,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACzB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpB,CAAe,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE;oBACjC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAA,+BAAoB,EAAC,EAAE,CAAC,CAAC,CAAC;gBAC7D,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAA,+BAAoB,EAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,OAAwB;QAC9B,IAAA,yBAAiB,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACzB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpB,CAA8B,CAAC,OAAO,CACrC,CAAC,MAAgC,EAAE,KAAa,EAAE,EAAE;oBAClD,IAAI,CAAC,W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AAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,WAAmB,EAAE,IAAY;QACpC,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAE1D,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA3GD,wCA2GC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const v4_1 = require("../../v4");
|
|
5
|
+
const requestBuilder_1 = require("./requestBuilder");
|
|
6
|
+
describe('V4 RequestBuilder', () => {
|
|
7
|
+
let withRequestBody;
|
|
8
|
+
let interaction;
|
|
9
|
+
let builder;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
withRequestBody = vitest_1.vi.fn();
|
|
12
|
+
interaction = { withRequestBody };
|
|
13
|
+
builder = new requestBuilder_1.RequestBuilder(interaction);
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
vitest_1.vi.restoreAllMocks();
|
|
17
|
+
});
|
|
18
|
+
describe('#xmlBody', () => {
|
|
19
|
+
it('calls withRequestBody with application/xml content type', () => {
|
|
20
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'root').build((el) => {
|
|
21
|
+
el.appendElement('item', new Map(), 'value');
|
|
22
|
+
});
|
|
23
|
+
builder.xmlBody(body);
|
|
24
|
+
expect(withRequestBody).toHaveBeenCalledOnce();
|
|
25
|
+
expect(withRequestBody).toHaveBeenCalledWith(body, 'application/xml');
|
|
26
|
+
});
|
|
27
|
+
it('supports XmlBuilder with matchers', () => {
|
|
28
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'items').build((el) => {
|
|
29
|
+
el.eachLike('item', new Map(), (item) => item.appendText('value'));
|
|
30
|
+
});
|
|
31
|
+
builder.xmlBody(body);
|
|
32
|
+
expect(withRequestBody).toHaveBeenCalledOnce();
|
|
33
|
+
expect(withRequestBody).toHaveBeenCalledWith(body, 'application/xml');
|
|
34
|
+
});
|
|
35
|
+
it('returns the builder for chaining', () => {
|
|
36
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'root').build(() => { });
|
|
37
|
+
const result = builder.xmlBody(body);
|
|
38
|
+
expect(result).toBe(builder);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=requestBuilder.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestBuilder.spec.js","sourceRoot":"","sources":["../../../../src/v4/http/requestBuilder.spec.ts"],"names":[],"mappings":";;AACA,mCAA4B;AAC5B,iCAAsC;AACtC,qDAAkD;AAElD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,eAAyC,CAAC;IAC9C,IAAI,WAAgC,CAAC;IACrC,IAAI,OAAuB,CAAC;IAE5B,UAAU,CAAC,GAAG,EAAE;QACd,eAAe,GAAG,WAAE,CAAC,EAAE,EAAE,CAAC;QAC1B,WAAW,GAAG,EAAE,eAAe,EAAoC,CAAC;QACpE,OAAO,GAAG,IAAI,+BAAc,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,WAAE,CAAC,eAAe,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;YACjE,MAAM,IAAI,GAAG,IAAI,eAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,C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AAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Rules, TemplateHeaders, TemplateQuery } from '../../v3';
|
|
1
|
+
import type { Rules, TemplateHeaders, TemplateQuery } from '../../v3';
|
|
2
2
|
import { RequestBuilder } from './requestBuilder';
|
|
3
|
-
import { V4RequestWithPluginBuilder } from './types';
|
|
3
|
+
import type { V4RequestWithPluginBuilder } from './types';
|
|
4
4
|
export declare class RequestWithPluginBuilder extends RequestBuilder implements V4RequestWithPluginBuilder {
|
|
5
5
|
pluginContents(contentType: string, contents: string): V4RequestWithPluginBuilder;
|
|
6
6
|
query(query: TemplateQuery): V4RequestWithPluginBuilder;
|
|
7
7
|
headers(headers: TemplateHeaders): V4RequestWithPluginBuilder;
|
|
8
8
|
jsonBody(body: unknown): V4RequestWithPluginBuilder;
|
|
9
|
+
xmlBody(body: unknown): V4RequestWithPluginBuilder;
|
|
9
10
|
binaryFile(contentType: string, file: string): V4RequestWithPluginBuilder;
|
|
10
11
|
/**
|
|
11
12
|
* Sets the request body as multipart/form-data content for plugin-based interactions.
|
|
@@ -1,47 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.RequestWithPluginBuilder = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function RequestWithPluginBuilder() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
RequestWithPluginBuilder.prototype.pluginContents = function (contentType, contents) {
|
|
4
|
+
const requestBuilder_1 = require("./requestBuilder");
|
|
5
|
+
class RequestWithPluginBuilder extends requestBuilder_1.RequestBuilder {
|
|
6
|
+
pluginContents(contentType, contents) {
|
|
26
7
|
this.interaction.withPluginRequestInteractionContents(contentType, contents);
|
|
27
8
|
return this;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
}
|
|
10
|
+
query(query) {
|
|
11
|
+
super.query(query);
|
|
31
12
|
return this;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
13
|
+
}
|
|
14
|
+
headers(headers) {
|
|
15
|
+
super.headers(headers);
|
|
35
16
|
return this;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
}
|
|
18
|
+
jsonBody(body) {
|
|
19
|
+
super.jsonBody(body);
|
|
39
20
|
return this;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
21
|
+
}
|
|
22
|
+
xmlBody(body) {
|
|
23
|
+
super.xmlBody(body);
|
|
43
24
|
return this;
|
|
44
|
-
}
|
|
25
|
+
}
|
|
26
|
+
binaryFile(contentType, file) {
|
|
27
|
+
super.binaryFile(contentType, file);
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
45
30
|
/**
|
|
46
31
|
* Sets the request body as multipart/form-data content for plugin-based interactions.
|
|
47
32
|
* This is useful for testing APIs that accept file uploads or multipart form submissions.
|
|
@@ -52,10 +37,10 @@ var RequestWithPluginBuilder = /** @class */ (function (_super) {
|
|
|
52
37
|
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
53
38
|
* @returns The V4RequestWithPluginBuilder instance for method chaining
|
|
54
39
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
multipartBody(contentType, file, mimePartName, boundary) {
|
|
41
|
+
super.multipartBody(contentType, file, mimePartName, boundary);
|
|
57
42
|
return this;
|
|
58
|
-
}
|
|
43
|
+
}
|
|
59
44
|
/**
|
|
60
45
|
* Applies matching rules to the consumer request.
|
|
61
46
|
* Matching rules allow you to define flexible matching criteria for request attributes
|
|
@@ -64,15 +49,14 @@ var RequestWithPluginBuilder = /** @class */ (function (_super) {
|
|
|
64
49
|
* @param rules - The matching rules as a strongly typed Rules object. Rules should follow the Pact matching rules format.
|
|
65
50
|
* @returns The V4RequestWithPluginBuilder instance for method chaining
|
|
66
51
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
matchingRules(rules) {
|
|
53
|
+
super.matchingRules(rules);
|
|
69
54
|
return this;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
}
|
|
56
|
+
body(contentType, body) {
|
|
57
|
+
super.body(contentType, body);
|
|
73
58
|
return this;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
}(requestBuilder_1.RequestBuilder));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
77
61
|
exports.RequestWithPluginBuilder = RequestWithPluginBuilder;
|
|
78
62
|
//# sourceMappingURL=requestWithPluginBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestWithPluginBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/requestWithPluginBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestWithPluginBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/requestWithPluginBuilder.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAGlD,MAAa,wBACX,SAAQ,+BAAc;IAGtB,cAAc,CACZ,WAAmB,EACn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
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const v4_1 = require("../../v4");
|
|
5
|
+
const requestWithPluginBuilder_1 = require("./requestWithPluginBuilder");
|
|
6
|
+
describe('V4 RequestWithPluginBuilder', () => {
|
|
7
|
+
let withRequestBody;
|
|
8
|
+
let interaction;
|
|
9
|
+
let builder;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
withRequestBody = vitest_1.vi.fn();
|
|
12
|
+
interaction = { withRequestBody };
|
|
13
|
+
builder = new requestWithPluginBuilder_1.RequestWithPluginBuilder(interaction);
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
vitest_1.vi.restoreAllMocks();
|
|
17
|
+
});
|
|
18
|
+
describe('#xmlBody', () => {
|
|
19
|
+
it('delegates to parent and calls withRequestBody with application/xml', () => {
|
|
20
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'root').build((el) => {
|
|
21
|
+
el.appendElement('item', new Map(), 'value');
|
|
22
|
+
});
|
|
23
|
+
builder.xmlBody(body);
|
|
24
|
+
expect(withRequestBody).toHaveBeenCalledOnce();
|
|
25
|
+
expect(withRequestBody).toHaveBeenCalledWith(body, 'application/xml');
|
|
26
|
+
});
|
|
27
|
+
it('returns a V4RequestWithPluginBuilder for chaining', () => {
|
|
28
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'root').build(() => { });
|
|
29
|
+
const result = builder.xmlBody(body);
|
|
30
|
+
expect(result).toBe(builder);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=requestWithPluginBuilder.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestWithPluginBuilder.spec.js","sourceRoot":"","sources":["../../../../src/v4/http/requestWithPluginBuilder.spec.ts"],"names":[],"mappings":";;AACA,mCAA4B;AAC5B,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,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ConsumerInteraction } from '@pact-foundation/pact-core';
|
|
2
|
-
import {
|
|
3
|
-
import { V4ResponseBuilder } from './types';
|
|
1
|
+
import type { ConsumerInteraction } from '@pact-foundation/pact-core';
|
|
2
|
+
import type { Rules, TemplateHeaders } from '../../v3';
|
|
3
|
+
import type { V4ResponseBuilder } from './types';
|
|
4
4
|
export declare class ResponseBuilder implements V4ResponseBuilder {
|
|
5
5
|
protected interaction: ConsumerInteraction;
|
|
6
6
|
constructor(interaction: ConsumerInteraction);
|
|
7
7
|
headers(headers: TemplateHeaders): V4ResponseBuilder;
|
|
8
8
|
jsonBody(body: unknown): V4ResponseBuilder;
|
|
9
|
+
xmlBody(body: unknown): V4ResponseBuilder;
|
|
9
10
|
binaryFile(contentType: string, file: string): V4ResponseBuilder;
|
|
10
11
|
/**
|
|
11
12
|
* Sets the response body as multipart/form-data content.
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ResponseBuilder = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const ramda_1 = require("ramda");
|
|
5
|
+
const matchingRules_1 = require("../../common/matchingRules");
|
|
6
|
+
const matchers_1 = require("../../v3/matchers");
|
|
7
|
+
const _1 = require(".");
|
|
8
|
+
class ResponseBuilder {
|
|
9
|
+
interaction;
|
|
10
|
+
constructor(interaction) {
|
|
10
11
|
this.interaction = interaction;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_this.interaction.withResponseHeader("".concat(k), 0, (0, matchers_1.matcherValueOrString)(v));
|
|
13
|
+
headers(headers) {
|
|
14
|
+
(0, ramda_1.forEachObjIndexed)((v, k) => {
|
|
15
|
+
this.interaction.withResponseHeader(`${k}`, 0, (0, matchers_1.matcherValueOrString)(v));
|
|
16
16
|
}, headers);
|
|
17
17
|
return this;
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
}
|
|
19
|
+
jsonBody(body) {
|
|
20
20
|
this.interaction.withResponseBody((0, matchers_1.matcherValueOrString)(body), 'application/json');
|
|
21
21
|
return this;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
}
|
|
23
|
+
xmlBody(body) {
|
|
24
|
+
this.interaction.withResponseBody((0, matchers_1.matcherValueOrString)(body), 'application/xml');
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
binaryFile(contentType, file) {
|
|
28
|
+
const body = (0, _1.readBinaryData)(file);
|
|
25
29
|
this.interaction.withResponseBinaryBody(body, contentType);
|
|
26
30
|
return this;
|
|
27
|
-
}
|
|
31
|
+
}
|
|
28
32
|
/**
|
|
29
33
|
* Sets the response body as multipart/form-data content.
|
|
30
34
|
* This is useful for testing APIs that respond with multipart/form-data.
|
|
@@ -35,10 +39,10 @@ var ResponseBuilder = /** @class */ (function () {
|
|
|
35
39
|
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
36
40
|
* @returns The V4ResponseBuilder instance for method chaining
|
|
37
41
|
*/
|
|
38
|
-
|
|
42
|
+
multipartBody(contentType, file, mimePartName, boundary) {
|
|
39
43
|
this.interaction.withResponseMultipartBody(contentType, file, mimePartName, boundary);
|
|
40
44
|
return this;
|
|
41
|
-
}
|
|
45
|
+
}
|
|
42
46
|
/**
|
|
43
47
|
* Applies matching rules to the provider response.
|
|
44
48
|
* Matching rules allow you to define flexible matching criteria for response attributes
|
|
@@ -47,17 +51,16 @@ var ResponseBuilder = /** @class */ (function () {
|
|
|
47
51
|
* @param rules - The matching rules as a strongly typed Rules object. Rules should follow the Pact matching rules format.
|
|
48
52
|
* @returns The V4ResponseBuilder instance for method chaining
|
|
49
53
|
*/
|
|
50
|
-
|
|
54
|
+
matchingRules(rules) {
|
|
51
55
|
(0, matchingRules_1.validateRules)(rules);
|
|
52
|
-
|
|
56
|
+
const ffiRules = (0, matchingRules_1.convertRulesToFFI)(rules);
|
|
53
57
|
this.interaction.withResponseMatchingRules(JSON.stringify(ffiRules));
|
|
54
58
|
return this;
|
|
55
|
-
}
|
|
56
|
-
|
|
59
|
+
}
|
|
60
|
+
body(contentType, body) {
|
|
57
61
|
this.interaction.withResponseBinaryBody(body, contentType);
|
|
58
62
|
return this;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}());
|
|
63
|
+
}
|
|
64
|
+
}
|
|
62
65
|
exports.ResponseBuilder = ResponseBuilder;
|
|
63
66
|
//# sourceMappingURL=responseBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responseBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/responseBuilder.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"file":"responseBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/responseBuilder.ts"],"names":[],"mappings":";;;AACA,iCAA0C;AAC1C,8DAA8E;AAE9E,gDAAyD;AACzD,wBAAmC;AAGnC,MAAa,eAAe;IAChB,WAAW,CAAsB;IAE3C,YAAY,WAAgC;QAC1C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,OAAO,CAAC,OAAwB;QAC9B,IAAA,yBAAiB,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACzB,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,IAAA,+BAAoB,EAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,CAAC,EAAE,OAAO,CAAC,CAAC;QAEZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,IA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1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const v4_1 = require("../../v4");
|
|
5
|
+
const responseBuilder_1 = require("./responseBuilder");
|
|
6
|
+
describe('V4 ResponseBuilder', () => {
|
|
7
|
+
let withResponseBody;
|
|
8
|
+
let interaction;
|
|
9
|
+
let builder;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
withResponseBody = vitest_1.vi.fn();
|
|
12
|
+
interaction = { withResponseBody };
|
|
13
|
+
builder = new responseBuilder_1.ResponseBuilder(interaction);
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
vitest_1.vi.restoreAllMocks();
|
|
17
|
+
});
|
|
18
|
+
describe('#xmlBody', () => {
|
|
19
|
+
it('calls withResponseBody with application/xml content type', () => {
|
|
20
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'root').build((el) => {
|
|
21
|
+
el.appendElement('item', new Map(), 'value');
|
|
22
|
+
});
|
|
23
|
+
builder.xmlBody(body);
|
|
24
|
+
expect(withResponseBody).toHaveBeenCalledOnce();
|
|
25
|
+
expect(withResponseBody).toHaveBeenCalledWith(body, 'application/xml');
|
|
26
|
+
});
|
|
27
|
+
it('supports XmlBuilder with matchers', () => {
|
|
28
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'items').build((el) => {
|
|
29
|
+
el.eachLike('item', new Map(), (item) => item.appendText('value'));
|
|
30
|
+
});
|
|
31
|
+
builder.xmlBody(body);
|
|
32
|
+
expect(withResponseBody).toHaveBeenCalledOnce();
|
|
33
|
+
expect(withResponseBody).toHaveBeenCalledWith(body, 'application/xml');
|
|
34
|
+
});
|
|
35
|
+
it('returns the builder for chaining', () => {
|
|
36
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'root').build(() => { });
|
|
37
|
+
const result = builder.xmlBody(body);
|
|
38
|
+
expect(result).toBe(builder);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=responseBuilder.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responseBuilder.spec.js","sourceRoot":"","sources":["../../../../src/v4/http/responseBuilder.spec.ts"],"names":[],"mappings":";;AACA,mCAA4B;AAC5B,iCAAsC;AACtC,uDAAoD;AAEpD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,gBAA0C,CAAC;IAC/C,IAAI,WAAgC,CAAC;IACrC,IAAI,OAAwB,CAAC;IAE7B,UAAU,CAAC,GAAG,EAAE;QACd,gBAAgB,GAAG,WAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,WAAW,GAAG,EAAE,gBAAgB,EAAoC,CAAC;QACrE,OAAO,GAAG,IAAI,iCAAe,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,WAAE,CAAC,eAAe,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAClE,MAAM,IAAI,GAAG,IAAI,eAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;gBAC/D,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAEtB,MAAM,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,EAAE,CAAC;YAChD,MAAM,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,IAAI,GAAG,IAAI,eAAU,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;gBAChE,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;YACrE,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAEtB,MAAM,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,EAAE,CAAC;YAChD,MAAM,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YAC1C,MAAM,IAAI,GAAG,IAAI,eAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAEpE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAErC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResponseBuilder } from './responseBuilder';
|
|
2
|
-
import {
|
|
2
|
+
import type { V4ResponseBuilder, V4ResponseWithPluginBuilder } from './types';
|
|
3
3
|
export declare class ResponseWithPluginBuilder extends ResponseBuilder implements V4ResponseWithPluginBuilder {
|
|
4
4
|
pluginContents(contentType: string, contents: string): V4ResponseBuilder;
|
|
5
5
|
}
|
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.ResponseWithPluginBuilder = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function ResponseWithPluginBuilder() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
ResponseWithPluginBuilder.prototype.pluginContents = function (contentType, contents) {
|
|
4
|
+
const responseBuilder_1 = require("./responseBuilder");
|
|
5
|
+
class ResponseWithPluginBuilder extends responseBuilder_1.ResponseBuilder {
|
|
6
|
+
pluginContents(contentType, contents) {
|
|
26
7
|
this.interaction.withPluginResponseInteractionContents(contentType, contents);
|
|
27
8
|
return this;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}(responseBuilder_1.ResponseBuilder));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
31
11
|
exports.ResponseWithPluginBuilder = ResponseWithPluginBuilder;
|
|
32
12
|
//# sourceMappingURL=responseWithPluginBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responseWithPluginBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/responseWithPluginBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"responseWithPluginBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/responseWithPluginBuilder.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAGpD,MAAa,yBACX,SAAQ,iCAAe;IAGvB,cAAc,CAAC,WAAmB,EAAE,QAAgB;QAClD,IAAI,CAAC,WAAW,CAAC,qCAAqC,CACpD,WAAW,EACX,QAAQ,CACT,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAXD,8DAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const v4_1 = require("../../v4");
|
|
5
|
+
const responseWithPluginBuilder_1 = require("./responseWithPluginBuilder");
|
|
6
|
+
describe('V4 ResponseWithPluginBuilder', () => {
|
|
7
|
+
let withResponseBody;
|
|
8
|
+
let interaction;
|
|
9
|
+
let builder;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
withResponseBody = vitest_1.vi.fn();
|
|
12
|
+
interaction = { withResponseBody };
|
|
13
|
+
builder = new responseWithPluginBuilder_1.ResponseWithPluginBuilder(interaction);
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
vitest_1.vi.restoreAllMocks();
|
|
17
|
+
});
|
|
18
|
+
describe('#xmlBody', () => {
|
|
19
|
+
it('calls withResponseBody with application/xml content type', () => {
|
|
20
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'root').build((el) => {
|
|
21
|
+
el.appendElement('item', new Map(), 'value');
|
|
22
|
+
});
|
|
23
|
+
builder.xmlBody(body);
|
|
24
|
+
expect(withResponseBody).toHaveBeenCalledOnce();
|
|
25
|
+
expect(withResponseBody).toHaveBeenCalledWith(body, 'application/xml');
|
|
26
|
+
});
|
|
27
|
+
it('returns the builder for chaining', () => {
|
|
28
|
+
const body = new v4_1.XmlBuilder('1.0', 'UTF-8', 'root').build(() => { });
|
|
29
|
+
const result = builder.xmlBody(body);
|
|
30
|
+
expect(result).toBe(builder);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=responseWithPluginBuilder.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responseWithPluginBuilder.spec.js","sourceRoot":"","sources":["../../../../src/v4/http/responseWithPluginBuilder.spec.ts"],"names":[],"mappings":";;AACA,mCAA4B;AAC5B,iCAAsC;AACtC,2EAAwE;AAExE,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,IAAI,gBAA0C,CAAC;IAC/C,IAAI,WAAgC,CAAC;IACrC,IAAI,OAAkC,CAAC;IAEvC,UAAU,CAAC,GAAG,EAAE;QACd,gBAAgB,GAAG,WAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,WAAW,GAAG,EAAE,gBAAgB,EAAoC,CAAC;QACrE,OAAO,GAAG,IAAI,qDAAyB,CAAC,WAAW,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,WAAE,CAAC,eAAe,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAClE,MAAM,IAAI,GAAG,IAAI,eAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;gBAC/D,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAEtB,MAA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