@pact-foundation/pact 16.0.2 → 16.0.3
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 +7 -0
- package/README.md +1 -1
- package/package.json +15 -15
- package/src/v3/pact.d.ts +24 -2
- package/src/v3/pact.js +26 -4
- package/src/v3/pact.js.map +1 -1
- package/src/v4/http/requestBuilder.d.ts +11 -1
- package/src/v4/http/requestBuilder.js +12 -2
- package/src/v4/http/requestBuilder.js.map +1 -1
- package/src/v4/http/requestWithPluginBuilder.d.ts +11 -1
- package/src/v4/http/requestWithPluginBuilder.js +12 -2
- package/src/v4/http/requestWithPluginBuilder.js.map +1 -1
- package/src/v4/http/responseBuilder.d.ts +11 -1
- package/src/v4/http/responseBuilder.js +12 -2
- package/src/v4/http/responseBuilder.js.map +1 -1
- package/src/v4/http/types.d.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [16.0.3](https://github.com/pact-foundation/pact-js/compare/v16.0.2...v16.0.3) (2025-12-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Fixes and Improvements
|
|
9
|
+
|
|
10
|
+
* replace deprecated macos 13 build with macos-15-intel ([#1628](https://github.com/pact-foundation/pact-js/issues/1628)) ([4a96350](https://github.com/pact-foundation/pact-js/commit/4a96350227363a09953d40e203f629c3412cad15))
|
|
11
|
+
|
|
5
12
|
## [16.0.2](https://github.com/pact-foundation/pact-js/compare/v16.0.1...v16.0.2) (2025-10-21)
|
|
6
13
|
|
|
7
14
|
|
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ In order to get better statistics as to who is using Pact, we have an anonymous
|
|
|
115
115
|
|
|
116
116
|
### Consumer package
|
|
117
117
|
|
|
118
|
-
The main consumer
|
|
118
|
+
The main consumer interfaces are the `PactV3` class and `MatchersV3` exports of the `@pact-foundation/pact` package.
|
|
119
119
|
|
|
120
120
|
#### Writing a Consumer test
|
|
121
121
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pact-foundation/pact",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.3",
|
|
4
4
|
"description": "Pact for all things Javascript",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@pact-foundation/pact-core": "^17.0.
|
|
106
|
+
"@pact-foundation/pact-core": "^17.0.2",
|
|
107
107
|
"axios": "^1.12.2",
|
|
108
108
|
"body-parser": "^2.2.0",
|
|
109
109
|
"chalk": "4.1.2",
|
|
@@ -121,26 +121,26 @@
|
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@babel/cli": "7.28.3",
|
|
124
|
-
"@babel/core": "7.28.
|
|
125
|
-
"@babel/preset-env": "7.28.
|
|
124
|
+
"@babel/core": "7.28.5",
|
|
125
|
+
"@babel/preset-env": "7.28.5",
|
|
126
126
|
"@pact-foundation/pact-js-prettier-config": "1.0.0",
|
|
127
127
|
"@types/chai": "5.2.3",
|
|
128
128
|
"@types/chai-as-promised": "8.0.2",
|
|
129
|
-
"@types/express": "4.17.
|
|
130
|
-
"@types/http-proxy": "1.17.
|
|
131
|
-
"@types/lodash": "4.17.
|
|
129
|
+
"@types/express": "4.17.25",
|
|
130
|
+
"@types/http-proxy": "1.17.17",
|
|
131
|
+
"@types/lodash": "4.17.21",
|
|
132
132
|
"@types/mocha": "10.0.10",
|
|
133
133
|
"@types/nock": "11.1.0",
|
|
134
|
-
"@types/node": "
|
|
134
|
+
"@types/node": "24.10.4",
|
|
135
135
|
"@types/ramda": "0.31.1",
|
|
136
|
-
"@types/sinon": "
|
|
136
|
+
"@types/sinon": "21.0.0",
|
|
137
137
|
"@types/sinon-chai": "4.0.0",
|
|
138
|
-
"@types/stack-utils": "
|
|
138
|
+
"@types/stack-utils": "2.0.3",
|
|
139
139
|
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
140
140
|
"@typescript-eslint/parser": "5.62.0",
|
|
141
|
-
"chai": "6.2.
|
|
141
|
+
"chai": "6.2.1",
|
|
142
142
|
"chai-as-promised": "8.0.2",
|
|
143
|
-
"commit-and-tag-version": "12.6.
|
|
143
|
+
"commit-and-tag-version": "12.6.1",
|
|
144
144
|
"copyfiles": "2.4.1",
|
|
145
145
|
"eslint": "8.57.1",
|
|
146
146
|
"eslint-config-airbnb-base": "15.0.0",
|
|
@@ -150,16 +150,16 @@
|
|
|
150
150
|
"eslint-plugin-chai-friendly": "1.1.0",
|
|
151
151
|
"eslint-plugin-import": "2.32.0",
|
|
152
152
|
"eslint-plugin-mocha": "10.5.0",
|
|
153
|
-
"mocha": "11.7.
|
|
153
|
+
"mocha": "11.7.5",
|
|
154
154
|
"nock": "14.0.10",
|
|
155
155
|
"nyc": "17.1.0",
|
|
156
156
|
"prettier": "3.6.2",
|
|
157
157
|
"proxyquire": "2.1.3",
|
|
158
|
-
"rimraf": "6.
|
|
158
|
+
"rimraf": "6.1.2",
|
|
159
159
|
"sinon": "21.0.0",
|
|
160
160
|
"sinon-chai": "4.0.1",
|
|
161
161
|
"source-map-support": "0.5.21",
|
|
162
|
-
"tsx": "4.
|
|
162
|
+
"tsx": "4.21.0",
|
|
163
163
|
"typescript": "5.9.3"
|
|
164
164
|
}
|
|
165
165
|
}
|
package/src/v3/pact.d.ts
CHANGED
|
@@ -11,10 +11,32 @@ export declare class PactV3 {
|
|
|
11
11
|
uponReceiving(description: string): PactV3;
|
|
12
12
|
withRequest(req: V3Request): PactV3;
|
|
13
13
|
withRequestBinaryFile(req: V3Request, contentType: string, file: string): PactV3;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Sets up the expected consumer request with multipart file upload data.
|
|
16
|
+
* This is useful for testing APIs that accept multipart/form-data uploads.
|
|
17
|
+
*
|
|
18
|
+
* @param req - The request configuration (method, path, headers, etc.)
|
|
19
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
20
|
+
* @param file - Path to the file containing the multipart body content
|
|
21
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
22
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
23
|
+
* @returns The PactV3 instance for method chaining
|
|
24
|
+
*/
|
|
25
|
+
withRequestMultipartFileUpload(req: V3Request, contentType: string, file: string, mimePartName: string, boundary?: string): PactV3;
|
|
15
26
|
willRespondWith(res: V3Response): PactV3;
|
|
16
27
|
withResponseBinaryFile(res: V3Response, contentType: string, file: string): PactV3;
|
|
17
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Sets up the expected provider response with multipart file upload data.
|
|
30
|
+
* This is useful for testing APIs that respond with multipart/form-data content.
|
|
31
|
+
*
|
|
32
|
+
* @param res - The response configuration (status, headers, etc.)
|
|
33
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
34
|
+
* @param file - Path to the file containing the multipart body content
|
|
35
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
36
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
37
|
+
* @returns The PactV3 instance for method chaining
|
|
38
|
+
*/
|
|
39
|
+
withResponseMultipartFileUpload(res: V3Response, contentType: string, file: string, mimePartName: string, boundary?: string): PactV3;
|
|
18
40
|
executeTest<T>(testFn: (mockServer: V3MockServer) => Promise<T>): Promise<T | undefined>;
|
|
19
41
|
private cleanup;
|
|
20
42
|
private setup;
|
package/src/v3/pact.js
CHANGED
|
@@ -122,8 +122,19 @@ var PactV3 = /** @class */ (function () {
|
|
|
122
122
|
(0, ffi_1.setRequestDetails)(this.interaction, req);
|
|
123
123
|
return this;
|
|
124
124
|
};
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Sets up the expected consumer request with multipart file upload data.
|
|
127
|
+
* This is useful for testing APIs that accept multipart/form-data uploads.
|
|
128
|
+
*
|
|
129
|
+
* @param req - The request configuration (method, path, headers, etc.)
|
|
130
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
131
|
+
* @param file - Path to the file containing the multipart body content
|
|
132
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
133
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
134
|
+
* @returns The PactV3 instance for method chaining
|
|
135
|
+
*/
|
|
136
|
+
PactV3.prototype.withRequestMultipartFileUpload = function (req, contentType, file, mimePartName, boundary) {
|
|
137
|
+
this.interaction.withRequestMultipartBody(contentType, file, mimePartName, boundary);
|
|
127
138
|
(0, ffi_1.setRequestDetails)(this.interaction, req);
|
|
128
139
|
return this;
|
|
129
140
|
};
|
|
@@ -142,8 +153,19 @@ var PactV3 = /** @class */ (function () {
|
|
|
142
153
|
(0, ffi_1.setResponseDetails)(this.interaction, res);
|
|
143
154
|
return this;
|
|
144
155
|
};
|
|
145
|
-
|
|
146
|
-
|
|
156
|
+
/**
|
|
157
|
+
* Sets up the expected provider response with multipart file upload data.
|
|
158
|
+
* This is useful for testing APIs that respond with multipart/form-data content.
|
|
159
|
+
*
|
|
160
|
+
* @param res - The response configuration (status, headers, etc.)
|
|
161
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
162
|
+
* @param file - Path to the file containing the multipart body content
|
|
163
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
164
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
165
|
+
* @returns The PactV3 instance for method chaining
|
|
166
|
+
*/
|
|
167
|
+
PactV3.prototype.withResponseMultipartFileUpload = function (res, contentType, file, mimePartName, boundary) {
|
|
168
|
+
this.interaction.withResponseMultipartBody(contentType, file, mimePartName, boundary);
|
|
147
169
|
(0, ffi_1.setResponseDetails)(this.interaction, res);
|
|
148
170
|
return this;
|
|
149
171
|
};
|
package/src/v3/pact.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pact.js","sourceRoot":"","sources":["../../../src/v3/pact.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,wDAIoC;AACpC,uBAA0B;AAC1B,mDAAmE;AAEnE,iCAQiB;AACjB,uCAAkD;AAClD,qCAA8E;AAC9E,4DAAsC;AACtC,6BAIe;AAEf,IAAM,cAAc,GAAG,UAAC,IAAY;IAClC,IAAI,CAAC;QACH,IAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAEnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,kDAA2C,CAAC,CAAC,OAAO,CAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CAAC;AAEF;IASE,gBAAY,IAAmB;QANvB,WAAM,GAAsB,EAAE,CAAC;QAOrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,sFAAsF;IAC/E,+BAAc,GAArB,UAAsB,WAA0B;QAAhD,iBAeC;QAdC,IAAI,WAAW,CAAC,aAAa,KAAK,EAAE,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;QACJ,CAAC;QAED,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAC,CAAC;YACnC,KAAI,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,aAA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IAAI,CAAC,QAAQ,EAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAClB,MAAA,IAAI,CAAC,IAAI,CAAC,IAAI,mCAAI,4BAAoB,CAAC,wBAAwB,EAC/D,MAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,MAAM,CAC7B,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,sBAAkB,CAAC,CAAC;IAClE,CAAC;IACH,aAAC;AAAD,CAAC,AA9PD,IA8PC;AA9PY,wBAAM"}
|
|
@@ -8,6 +8,16 @@ export declare class RequestBuilder implements V4RequestBuilder {
|
|
|
8
8
|
headers(headers: TemplateHeaders): V4RequestBuilder;
|
|
9
9
|
jsonBody(body: unknown): V4RequestBuilder;
|
|
10
10
|
binaryFile(contentType: string, file: string): V4RequestBuilder;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Sets the request body as multipart/form-data content.
|
|
13
|
+
* This is useful for testing APIs that accept file uploads or multipart form submissions.
|
|
14
|
+
*
|
|
15
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
16
|
+
* @param file - Path to the file containing the multipart body content
|
|
17
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
18
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
19
|
+
* @returns The V4RequestBuilder instance for method chaining
|
|
20
|
+
*/
|
|
21
|
+
multipartBody(contentType: string, file: string, mimePartName: string, boundary?: string): V4RequestBuilder;
|
|
12
22
|
body(contentType: string, body: Buffer): V4RequestBuilder;
|
|
13
23
|
}
|
|
@@ -46,8 +46,18 @@ var RequestBuilder = /** @class */ (function () {
|
|
|
46
46
|
this.interaction.withRequestBinaryBody(body, contentType);
|
|
47
47
|
return this;
|
|
48
48
|
};
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Sets the request body as multipart/form-data content.
|
|
51
|
+
* This is useful for testing APIs that accept file uploads or multipart form submissions.
|
|
52
|
+
*
|
|
53
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
54
|
+
* @param file - Path to the file containing the multipart body content
|
|
55
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
56
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
57
|
+
* @returns The V4RequestBuilder instance for method chaining
|
|
58
|
+
*/
|
|
59
|
+
RequestBuilder.prototype.multipartBody = function (contentType, file, mimePartName, boundary) {
|
|
60
|
+
this.interaction.withRequestMultipartBody(contentType, file, mimePartName, boundary);
|
|
51
61
|
return this;
|
|
52
62
|
};
|
|
53
63
|
RequestBuilder.prototype.body = function (contentType, body) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/requestBuilder.ts"],"names":[],"mappings":";;;AACA,+BAA0C;AAE1C,8CAAyD;AAEzD,sBAAmC;AAEnC;IACE,mCAAmC;IACnC,wBAAsB,WAAgC;QAAhC,gBAAW,GAAX,WAAW,CAAqB;IAAG,CAAC;IAE1D,8BAAK,GAAL,UAAM,KAAoB;QAA1B,iBAYC;QAXC,IAAA,yBAAiB,EAAC,UAAC,CAAC,EAAE,CAAC;YACrB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpB,CAAe,CAAC,OAAO,CAAC,UAAC,EAAE,EAAE,CAAC;oBAC7B,KAAI,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,KAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAA,+BAAoB,EAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,EAAE,KAAK,CAAC,CA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AAC;IACd,CAAC;IAED,iCAAQ,GAAR,UAAS,IAAa;QACpB,IAAI,CAAC,WAAW,CAAC,eAAe,CAC9B,IAAA,+BAAoB,EAAC,IAAI,CAAC,EAC1B,kBAAkB,CACnB,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mCAAU,GAAV,UAAW,WAAmB,EAAE,IAAY;QAC1C,IAAM,IAAI,GAAG,IAAA,iBAAc,EAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAE1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;OASG;IACH,sCAAa,GAAb,UACE,WAAmB,EACnB,IAAY,EACZ,YAAoB,EACpB,QAAiB;QAEjB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CACvC,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,QAAQ,CACT,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,6BAAI,GAAJ,UAAK,WAAmB,EAAE,IAAY;QACpC,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAE1D,OAAO,IAAI,CAAC;IACd,CAAC;IACH,qBAAC;AAAD,CAAC,AApFD,IAoFC;AApFY,wCAAc"}
|
|
@@ -7,6 +7,16 @@ export declare class RequestWithPluginBuilder extends RequestBuilder implements
|
|
|
7
7
|
headers(headers: TemplateHeaders): V4RequestWithPluginBuilder;
|
|
8
8
|
jsonBody(body: unknown): V4RequestWithPluginBuilder;
|
|
9
9
|
binaryFile(contentType: string, file: string): V4RequestWithPluginBuilder;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Sets the request body as multipart/form-data content for plugin-based interactions.
|
|
12
|
+
* This is useful for testing APIs that accept file uploads or multipart form submissions.
|
|
13
|
+
*
|
|
14
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
15
|
+
* @param file - Path to the file containing the multipart body content
|
|
16
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
17
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
18
|
+
* @returns The V4RequestWithPluginBuilder instance for method chaining
|
|
19
|
+
*/
|
|
20
|
+
multipartBody(contentType: string, file: string, mimePartName: string, boundary?: string): V4RequestWithPluginBuilder;
|
|
11
21
|
body(contentType: string, body: Buffer): V4RequestWithPluginBuilder;
|
|
12
22
|
}
|
|
@@ -42,8 +42,18 @@ var RequestWithPluginBuilder = /** @class */ (function (_super) {
|
|
|
42
42
|
_super.prototype.binaryFile.call(this, contentType, file);
|
|
43
43
|
return this;
|
|
44
44
|
};
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Sets the request body as multipart/form-data content for plugin-based interactions.
|
|
47
|
+
* This is useful for testing APIs that accept file uploads or multipart form submissions.
|
|
48
|
+
*
|
|
49
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
50
|
+
* @param file - Path to the file containing the multipart body content
|
|
51
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
52
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
53
|
+
* @returns The V4RequestWithPluginBuilder instance for method chaining
|
|
54
|
+
*/
|
|
55
|
+
RequestWithPluginBuilder.prototype.multipartBody = function (contentType, file, mimePartName, boundary) {
|
|
56
|
+
_super.prototype.multipartBody.call(this, contentType, file, mimePartName, boundary);
|
|
47
57
|
return this;
|
|
48
58
|
};
|
|
49
59
|
RequestWithPluginBuilder.prototype.body = function (contentType, body) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestWithPluginBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/requestWithPluginBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,mDAAkD;AAGlD;IACU,4CAAc;IADxB;;
|
|
1
|
+
{"version":3,"file":"requ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7,6 +7,16 @@ export declare class ResponseBuilder implements V4ResponseBuilder {
|
|
|
7
7
|
headers(headers: TemplateHeaders): V4ResponseBuilder;
|
|
8
8
|
jsonBody(body: unknown): V4ResponseBuilder;
|
|
9
9
|
binaryFile(contentType: string, file: string): V4ResponseBuilder;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Sets the response body as multipart/form-data content.
|
|
12
|
+
* This is useful for testing APIs that respond with multipart/form-data.
|
|
13
|
+
*
|
|
14
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
15
|
+
* @param file - Path to the file containing the multipart body content
|
|
16
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
17
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
18
|
+
* @returns The V4ResponseBuilder instance for method chaining
|
|
19
|
+
*/
|
|
20
|
+
multipartBody(contentType: string, file: string, mimePartName: string, boundary?: string): V4ResponseBuilder;
|
|
11
21
|
body(contentType: string, body: Buffer): V4ResponseBuilder;
|
|
12
22
|
}
|
|
@@ -24,8 +24,18 @@ var ResponseBuilder = /** @class */ (function () {
|
|
|
24
24
|
this.interaction.withResponseBinaryBody(body, contentType);
|
|
25
25
|
return this;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Sets the response body as multipart/form-data content.
|
|
29
|
+
* This is useful for testing APIs that respond with multipart/form-data.
|
|
30
|
+
*
|
|
31
|
+
* @param contentType - The content type of the multipart body (e.g., 'multipart/form-data')
|
|
32
|
+
* @param file - Path to the file containing the multipart body content
|
|
33
|
+
* @param mimePartName - The name of the mime part in the multipart body
|
|
34
|
+
* @param boundary - Optional boundary string for the multipart content. If not provided, will be passed as undefined.
|
|
35
|
+
* @returns The V4ResponseBuilder instance for method chaining
|
|
36
|
+
*/
|
|
37
|
+
ResponseBuilder.prototype.multipartBody = function (contentType, file, mimePartName, boundary) {
|
|
38
|
+
this.interaction.withResponseMultipartBody(contentType, file, mimePartName, boundary);
|
|
29
39
|
return this;
|
|
30
40
|
};
|
|
31
41
|
ResponseBuilder.prototype.body = function (contentType, body) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responseBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/responseBuilder.ts"],"names":[],"mappings":";;;AACA,+BAA0C;AAC1C,sBAAmC;AAEnC,8CAAyD;AAGzD;IAGE,yBAAY,WAAgC;QAC1C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,iCAAO,GAAP,UAAQ,OAAwB;QAAhC,iBAMC;QALC,IAAA,yBAAiB,EAAC,UAAC,CAAC,EAAE,CAAC;YACrB,KAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,UAAG,CAAC,CAAE,EAAE,CAAC,EAAE,IAAA,+BAAoB,EAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,CAAC,EAAE,OAAO,CAAC,CAAC;QAEZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,kCAAQ,GAAR,UAAS,IAAa;QACpB,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAC/B,IAAA,+BAAoB,EAAC,IAAI,CAAC,EAC1B,kBAAkB,CACnB,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oCAAU,GAAV,UAAW,WAAmB,EAAE,IAAY;QAC1C,IAAM,IAAI,GAAG,IAAA,iBAAc,EAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAE3D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uCAAa,GAAb,UACE,WAAmB,EACnB,IAAY,EACZ,YAAoB;
|
|
1
|
+
{"version":3,"file":"responseBuilder.js","sourceRoot":"","sources":["../../../../src/v4/http/responseBuilder.ts"],"names":[],"mappings":";;;AACA,+BAA0C;AAC1C,sBAAmC;AAEnC,8CAAyD;AAGzD;IAGE,yBAA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face V4RequestBuilder {
|
|
|
58
58
|
headers(headers: TemplateHeaders): V4RequestBuilder;
|
|
59
59
|
jsonBody(body: unknown): V4RequestBuilder;
|
|
60
60
|
binaryFile(contentType: string, file: string): V4RequestBuilder;
|
|
61
|
-
multipartBody(contentType: string, filename: string, mimePartName: string): V4RequestBuilder;
|
|
61
|
+
multipartBody(contentType: string, filename: string, mimePartName: string, boundary?: string): V4RequestBuilder;
|
|
62
62
|
body(contentType: string, body: Buffer): V4RequestBuilder;
|
|
63
63
|
}
|
|
64
64
|
export interface V4ResponseBuilder {
|
|
65
65
|
headers(headers: TemplateHeaders): V4ResponseBuilder;
|
|
66
66
|
jsonBody(body: unknown): V4ResponseBuilder;
|
|
67
67
|
binaryFile(contentType: string, file: string): V4ResponseBuilder;
|
|
68
|
-
multipartBody(contentType: string, filename: string, mimePartName: string): V4ResponseBuilder;
|
|
68
|
+
multipartBody(contentType: string, filename: string, mimePartName: string, boundary?: string): V4ResponseBuilder;
|
|
69
69
|
body(contentType: string, body: Buffer): V4ResponseBuilder;
|
|
70
70
|
}
|
|
71
71
|
export type V4ResponseBuilderFunc = (builder: V4ResponseBuilder) => void;
|
|
@@ -90,7 +90,7 @@ export interface V4RequestWithPluginBuilder {
|
|
|
90
90
|
headers(headers: TemplateHeaders): V4RequestWithPluginBuilder;
|
|
91
91
|
jsonBody(body: unknown): V4RequestWithPluginBuilder;
|
|
92
92
|
binaryFile(contentType: string, file: string): V4RequestWithPluginBuilder;
|
|
93
|
-
multipartBody(contentType: string, filename: string, mimePartName: string): V4RequestWithPluginBuilder;
|
|
93
|
+
multipartBody(contentType: string, filename: string, mimePartName: string, boundary?: string): V4RequestWithPluginBuilder;
|
|
94
94
|
body(contentType: string, body: Buffer): V4RequestWithPluginBuilder;
|
|
95
95
|
pluginContents(contentType: string, contents: string): V4RequestWithPluginBuilder;
|
|
96
96
|
}
|
|
@@ -98,7 +98,7 @@ export interface V4ResponseWithPluginBuilder {
|
|
|
98
98
|
headers(headers: TemplateHeaders): V4ResponseBuilder;
|
|
99
99
|
jsonBody(body: unknown): V4ResponseBuilder;
|
|
100
100
|
binaryFile(contentType: string, file: string): V4ResponseBuilder;
|
|
101
|
-
multipartBody(contentType: string, filename: string, mimePartName: string): V4ResponseBuilder;
|
|
101
|
+
multipartBody(contentType: string, filename: string, mimePartName: string, boundary?: string): V4ResponseBuilder;
|
|
102
102
|
body(contentType: string, body: Buffer): V4ResponseBuilder;
|
|
103
103
|
pluginContents(contentType: string, contents: string): V4ResponseBuilder;
|
|
104
104
|
}
|