@loadmill/core 0.3.108 → 0.3.109

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.
Files changed (196) hide show
  1. package/package.json +2 -2
  2. package/dist/conf/defaults.d.ts +0 -1
  3. package/dist/conf/defaults.js +0 -11
  4. package/dist/conf/defaults.js.map +0 -1
  5. package/dist/conf/extrema.d.ts +0 -7
  6. package/dist/conf/extrema.js +0 -12
  7. package/dist/conf/extrema.js.map +0 -1
  8. package/dist/conf/index.d.ts +0 -15
  9. package/dist/conf/index.js +0 -80
  10. package/dist/conf/index.js.map +0 -1
  11. package/dist/conf/notifications.d.ts +0 -2
  12. package/dist/conf/notifications.js +0 -19
  13. package/dist/conf/notifications.js.map +0 -1
  14. package/dist/conf/types.d.ts +0 -110
  15. package/dist/conf/types.js +0 -38
  16. package/dist/conf/types.js.map +0 -1
  17. package/dist/conf/validate.d.ts +0 -69
  18. package/dist/conf/validate.js +0 -495
  19. package/dist/conf/validate.js.map +0 -1
  20. package/dist/distributed-logger-reporter.d.ts +0 -3
  21. package/dist/distributed-logger-reporter.js +0 -74
  22. package/dist/distributed-logger-reporter.js.map +0 -1
  23. package/dist/echo/firehose.d.ts +0 -7
  24. package/dist/echo/firehose.js +0 -130
  25. package/dist/echo/firehose.js.map +0 -1
  26. package/dist/echo/index.d.ts +0 -3
  27. package/dist/echo/index.js +0 -8
  28. package/dist/echo/index.js.map +0 -1
  29. package/dist/echo/stats.d.ts +0 -8
  30. package/dist/echo/stats.js +0 -152
  31. package/dist/echo/stats.js.map +0 -1
  32. package/dist/har/index.d.ts +0 -68
  33. package/dist/har/index.js +0 -14
  34. package/dist/har/index.js.map +0 -1
  35. package/dist/labels/constants.d.ts +0 -1
  36. package/dist/labels/constants.js +0 -5
  37. package/dist/labels/constants.js.map +0 -1
  38. package/dist/multipart-form-data/files.d.ts +0 -2
  39. package/dist/multipart-form-data/files.js +0 -63
  40. package/dist/multipart-form-data/files.js.map +0 -1
  41. package/dist/multipart-form-data/form-data-utils.d.ts +0 -19
  42. package/dist/multipart-form-data/form-data-utils.js +0 -117
  43. package/dist/multipart-form-data/form-data-utils.js.map +0 -1
  44. package/dist/multipart-form-data/is-binary-file.d.ts +0 -2
  45. package/dist/multipart-form-data/is-binary-file.js +0 -215
  46. package/dist/multipart-form-data/is-binary-file.js.map +0 -1
  47. package/dist/multipart-form-data/multipart-text-to-post-form-data.d.ts +0 -2
  48. package/dist/multipart-form-data/multipart-text-to-post-form-data.js +0 -86
  49. package/dist/multipart-form-data/multipart-text-to-post-form-data.js.map +0 -1
  50. package/dist/parameters/extractions.d.ts +0 -26
  51. package/dist/parameters/extractions.js +0 -49
  52. package/dist/parameters/extractions.js.map +0 -1
  53. package/dist/parameters/extractors/cheerio-extractor.d.ts +0 -11
  54. package/dist/parameters/extractors/cheerio-extractor.js +0 -84
  55. package/dist/parameters/extractors/cheerio-extractor.js.map +0 -1
  56. package/dist/parameters/extractors/expression-extractor.d.ts +0 -6
  57. package/dist/parameters/extractors/expression-extractor.js +0 -38
  58. package/dist/parameters/extractors/expression-extractor.js.map +0 -1
  59. package/dist/parameters/extractors/extractor.d.ts +0 -3
  60. package/dist/parameters/extractors/extractor.js +0 -3
  61. package/dist/parameters/extractors/extractor.js.map +0 -1
  62. package/dist/parameters/extractors/header-extractor.d.ts +0 -7
  63. package/dist/parameters/extractors/header-extractor.js +0 -51
  64. package/dist/parameters/extractors/header-extractor.js.map +0 -1
  65. package/dist/parameters/extractors/index.d.ts +0 -10
  66. package/dist/parameters/extractors/index.js +0 -20
  67. package/dist/parameters/extractors/index.js.map +0 -1
  68. package/dist/parameters/extractors/json-path-extractor.d.ts +0 -11
  69. package/dist/parameters/extractors/json-path-extractor.js +0 -117
  70. package/dist/parameters/extractors/json-path-extractor.js.map +0 -1
  71. package/dist/parameters/extractors/parametrized-extractor.d.ts +0 -10
  72. package/dist/parameters/extractors/parametrized-extractor.js +0 -34
  73. package/dist/parameters/extractors/parametrized-extractor.js.map +0 -1
  74. package/dist/parameters/extractors/regex-extractor.d.ts +0 -7
  75. package/dist/parameters/extractors/regex-extractor.js +0 -46
  76. package/dist/parameters/extractors/regex-extractor.js.map +0 -1
  77. package/dist/parameters/extractors/regex-matcher.d.ts +0 -1
  78. package/dist/parameters/extractors/regex-matcher.js +0 -21
  79. package/dist/parameters/extractors/regex-matcher.js.map +0 -1
  80. package/dist/parameters/extractors/ws-extractor.d.ts +0 -33
  81. package/dist/parameters/extractors/ws-extractor.js +0 -215
  82. package/dist/parameters/extractors/ws-extractor.js.map +0 -1
  83. package/dist/parameters/extractors/x-path-extractor.d.ts +0 -9
  84. package/dist/parameters/extractors/x-path-extractor.js +0 -71
  85. package/dist/parameters/extractors/x-path-extractor.js.map +0 -1
  86. package/dist/parameters/generate-random.d.ts +0 -13
  87. package/dist/parameters/generate-random.js +0 -108
  88. package/dist/parameters/generate-random.js.map +0 -1
  89. package/dist/parameters/html-utils.d.ts +0 -1
  90. package/dist/parameters/html-utils.js +0 -18
  91. package/dist/parameters/html-utils.js.map +0 -1
  92. package/dist/parameters/index.d.ts +0 -89
  93. package/dist/parameters/index.js +0 -602
  94. package/dist/parameters/index.js.map +0 -1
  95. package/dist/parameters/json-path-utils.d.ts +0 -1
  96. package/dist/parameters/json-path-utils.js +0 -16
  97. package/dist/parameters/json-path-utils.js.map +0 -1
  98. package/dist/parameters/operators/binary-operator.d.ts +0 -13
  99. package/dist/parameters/operators/binary-operator.js +0 -39
  100. package/dist/parameters/operators/binary-operator.js.map +0 -1
  101. package/dist/parameters/operators/index.d.ts +0 -5
  102. package/dist/parameters/operators/index.js +0 -21
  103. package/dist/parameters/operators/index.js.map +0 -1
  104. package/dist/parameters/parameter-functions/boolean-parameter-functions.d.ts +0 -12
  105. package/dist/parameters/parameter-functions/boolean-parameter-functions.js +0 -47
  106. package/dist/parameters/parameter-functions/boolean-parameter-functions.js.map +0 -1
  107. package/dist/parameters/parameter-functions/crypto.d.ts +0 -11
  108. package/dist/parameters/parameter-functions/crypto.js +0 -71
  109. package/dist/parameters/parameter-functions/crypto.js.map +0 -1
  110. package/dist/parameters/parameter-functions/json-schema.d.ts +0 -1
  111. package/dist/parameters/parameter-functions/json-schema.js +0 -33
  112. package/dist/parameters/parameter-functions/json-schema.js.map +0 -1
  113. package/dist/parameters/parameter-functions/numeric-input-parameter-functions.d.ts +0 -11
  114. package/dist/parameters/parameter-functions/numeric-input-parameter-functions.js +0 -34
  115. package/dist/parameters/parameter-functions/numeric-input-parameter-functions.js.map +0 -1
  116. package/dist/parameters/parameter-functions/numeric-parameter-functions.d.ts +0 -15
  117. package/dist/parameters/parameter-functions/numeric-parameter-functions.js +0 -56
  118. package/dist/parameters/parameter-functions/numeric-parameter-functions.js.map +0 -1
  119. package/dist/parameters/parameter-functions/parameter-function-utils.d.ts +0 -5
  120. package/dist/parameters/parameter-functions/parameter-function-utils.js +0 -82
  121. package/dist/parameters/parameter-functions/parameter-function-utils.js.map +0 -1
  122. package/dist/parameters/parameter-functions/parameter-function.d.ts +0 -6
  123. package/dist/parameters/parameter-functions/parameter-function.js +0 -28
  124. package/dist/parameters/parameter-functions/parameter-function.js.map +0 -1
  125. package/dist/parameters/parameter-functions/parameter-functions.d.ts +0 -7
  126. package/dist/parameters/parameter-functions/parameter-functions.js +0 -53
  127. package/dist/parameters/parameter-functions/parameter-functions.js.map +0 -1
  128. package/dist/parameters/parameter-functions/random-parameter-functions.d.ts +0 -1
  129. package/dist/parameters/parameter-functions/random-parameter-functions.js +0 -43
  130. package/dist/parameters/parameter-functions/random-parameter-functions.js.map +0 -1
  131. package/dist/parameters/parameter-functions/textual-parameter-functions.d.ts +0 -67
  132. package/dist/parameters/parameter-functions/textual-parameter-functions.js +0 -374
  133. package/dist/parameters/parameter-functions/textual-parameter-functions.js.map +0 -1
  134. package/dist/parameters/parameter-name-utils.d.ts +0 -5
  135. package/dist/parameters/parameter-name-utils.js +0 -136
  136. package/dist/parameters/parameter-name-utils.js.map +0 -1
  137. package/dist/parameters/parameter-regex-providers.d.ts +0 -24
  138. package/dist/parameters/parameter-regex-providers.js +0 -70
  139. package/dist/parameters/parameter-regex-providers.js.map +0 -1
  140. package/dist/parameters/resolvers/random-parameters-resolver.d.ts +0 -1
  141. package/dist/parameters/resolvers/random-parameters-resolver.js +0 -12
  142. package/dist/parameters/resolvers/random-parameters-resolver.js.map +0 -1
  143. package/dist/parameters/type.d.ts +0 -10
  144. package/dist/parameters/type.js +0 -9
  145. package/dist/parameters/type.js.map +0 -1
  146. package/dist/parameters/value-utils.d.ts +0 -5
  147. package/dist/parameters/value-utils.js +0 -44
  148. package/dist/parameters/value-utils.js.map +0 -1
  149. package/dist/request/index.d.ts +0 -264
  150. package/dist/request/index.js +0 -538
  151. package/dist/request/index.js.map +0 -1
  152. package/dist/schema/json-schema-generator.d.ts +0 -20
  153. package/dist/schema/json-schema-generator.js +0 -135
  154. package/dist/schema/json-schema-generator.js.map +0 -1
  155. package/dist/signals.d.ts +0 -4
  156. package/dist/signals.js +0 -9
  157. package/dist/signals.js.map +0 -1
  158. package/dist/subset/index.d.ts +0 -3
  159. package/dist/subset/index.js +0 -8
  160. package/dist/subset/index.js.map +0 -1
  161. package/dist/subset/is-subset.d.ts +0 -2
  162. package/dist/subset/is-subset.js +0 -29
  163. package/dist/subset/is-subset.js.map +0 -1
  164. package/dist/subset/json-contains.d.ts +0 -1
  165. package/dist/subset/json-contains.js +0 -24
  166. package/dist/subset/json-contains.js.map +0 -1
  167. package/dist/team-options/constants.d.ts +0 -3
  168. package/dist/team-options/constants.js +0 -7
  169. package/dist/team-options/constants.js.map +0 -1
  170. package/dist/xml/decode.d.ts +0 -2
  171. package/dist/xml/decode.js +0 -87
  172. package/dist/xml/decode.js.map +0 -1
  173. package/dist/xml/encode.d.ts +0 -1
  174. package/dist/xml/encode.js +0 -14
  175. package/dist/xml/encode.js.map +0 -1
  176. package/dist/xml/escape-reserved-chars.d.ts +0 -6
  177. package/dist/xml/escape-reserved-chars.js +0 -57
  178. package/dist/xml/escape-reserved-chars.js.map +0 -1
  179. package/dist/xml/is-xml.d.ts +0 -1
  180. package/dist/xml/is-xml.js +0 -9
  181. package/dist/xml/is-xml.js.map +0 -1
  182. package/dist/xml/json-to-xml.d.ts +0 -2
  183. package/dist/xml/json-to-xml.js +0 -11
  184. package/dist/xml/json-to-xml.js.map +0 -1
  185. package/dist/xml/namespaces.d.ts +0 -7
  186. package/dist/xml/namespaces.js +0 -16
  187. package/dist/xml/namespaces.js.map +0 -1
  188. package/dist/xml/remove-invisible-chars.d.ts +0 -2
  189. package/dist/xml/remove-invisible-chars.js +0 -13
  190. package/dist/xml/remove-invisible-chars.js.map +0 -1
  191. package/dist/xml/replace-s-tags.d.ts +0 -4
  192. package/dist/xml/replace-s-tags.js +0 -21
  193. package/dist/xml/replace-s-tags.js.map +0 -1
  194. package/dist/xml/xml-to-json.d.ts +0 -7
  195. package/dist/xml/xml-to-json.js +0 -21
  196. package/dist/xml/xml-to-json.js.map +0 -1
@@ -1,538 +0,0 @@
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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.WsMessageType = exports.ConfMimeTypes = exports.getResponseText = exports.isGRPCRequest = exports.isHTTPRequest = exports.isWSRequest = exports.EXCLUDES = exports.CachePenetrationModes = exports.BodyTypes = exports.isReservedHeader = exports.findRequestIndex = exports.toHeaders = exports.createRequest = exports.resolveUrl = exports.LoadmillOrFinfRequest = exports.LoadmillRequest = exports.RequestType = exports.ALLOWED_RESPONSE_STATUSES = exports.supportedMethods = exports.DEFAULT_REQUEST_TIMEOUT = void 0;
38
- var flatMap = require("lodash/flatMap");
39
- var uriUtils = __importStar(require("@loadmill/universal/dist/uri-utils"));
40
- var parameters_1 = require("../parameters");
41
- exports.DEFAULT_REQUEST_TIMEOUT = 25000;
42
- exports.supportedMethods = {
43
- GET: 'GET',
44
- POST: 'POST',
45
- PUT: 'PUT',
46
- DELETE: 'DELETE',
47
- PATCH: 'PATCH',
48
- };
49
- exports.ALLOWED_RESPONSE_STATUSES = { SUCCESS: 'SUCCESS', ERROR: 'ERROR', ANY: 'ANY' };
50
- /**
51
- * This class represents an HTTP request to be performed in the course of a load test.
52
- *
53
- * @property url The URL of the request (parameterizable).
54
- * @property method The HTTP method.
55
- * @property headers An array of headers to add to the request (values parameterizable).
56
- * @property postData The content of the request (text parameterizable).
57
- * @property delay The delay between this request and the previous one in milliseconds. This property is ignored for the first request.
58
- * @property timeout The time to wait for the request to finish in milliseconds.
59
- * @property extract A dictionary of parameter extractions.
60
- * @property assert An array or dictionary of assertions.
61
- * @property expectedStatus The expected status of the http response SUCCESS for 2XX-3XX, ERROR for 4XX-5XX.
62
- */
63
- var RequestType;
64
- (function (RequestType) {
65
- RequestType["LOGIN"] = "login";
66
- RequestType["BEFORE_EACH"] = "beforeEach";
67
- RequestType["FLOW"] = "flow";
68
- RequestType["AFTER_EACH"] = "afterEach";
69
- RequestType["FINF"] = "flowInFlow";
70
- RequestType["BEFORE_ALL"] = "beforeAll";
71
- RequestType["AFTER_ALL"] = "afterAll";
72
- })(RequestType = exports.RequestType || (exports.RequestType = {}));
73
- var LoadmillRequest = /** @class */ (function () {
74
- function LoadmillRequest(url) {
75
- Object.defineProperty(this, "url", {
76
- enumerable: true,
77
- configurable: true,
78
- writable: true,
79
- value: url
80
- });
81
- Object.defineProperty(this, "id", {
82
- enumerable: true,
83
- configurable: true,
84
- writable: true,
85
- value: void 0
86
- });
87
- Object.defineProperty(this, "auth", {
88
- enumerable: true,
89
- configurable: true,
90
- writable: true,
91
- value: void 0
92
- });
93
- Object.defineProperty(this, "stopBefore", {
94
- enumerable: true,
95
- configurable: true,
96
- writable: true,
97
- value: void 0
98
- });
99
- Object.defineProperty(this, "skipBefore", {
100
- enumerable: true,
101
- configurable: true,
102
- writable: true,
103
- value: void 0
104
- });
105
- Object.defineProperty(this, "loop", {
106
- enumerable: true,
107
- configurable: true,
108
- writable: true,
109
- value: void 0
110
- });
111
- Object.defineProperty(this, "useCookies", {
112
- enumerable: true,
113
- configurable: true,
114
- writable: true,
115
- value: void 0
116
- });
117
- Object.defineProperty(this, "description", {
118
- enumerable: true,
119
- configurable: true,
120
- writable: true,
121
- value: void 0
122
- });
123
- Object.defineProperty(this, "delay", {
124
- enumerable: true,
125
- configurable: true,
126
- writable: true,
127
- value: void 0
128
- });
129
- Object.defineProperty(this, "postData", {
130
- enumerable: true,
131
- configurable: true,
132
- writable: true,
133
- value: void 0
134
- });
135
- Object.defineProperty(this, "postFormData", {
136
- enumerable: true,
137
- configurable: true,
138
- writable: true,
139
- value: void 0
140
- });
141
- Object.defineProperty(this, "graphqlPostData", {
142
- enumerable: true,
143
- configurable: true,
144
- writable: true,
145
- value: void 0
146
- });
147
- Object.defineProperty(this, "file", {
148
- enumerable: true,
149
- configurable: true,
150
- writable: true,
151
- value: void 0
152
- });
153
- Object.defineProperty(this, "grpc", {
154
- enumerable: true,
155
- configurable: true,
156
- writable: true,
157
- value: void 0
158
- });
159
- Object.defineProperty(this, "cachePenetration", {
160
- enumerable: true,
161
- configurable: true,
162
- writable: true,
163
- value: void 0
164
- });
165
- Object.defineProperty(this, "method", {
166
- enumerable: true,
167
- configurable: true,
168
- writable: true,
169
- value: 'GET'
170
- });
171
- Object.defineProperty(this, "headers", {
172
- enumerable: true,
173
- configurable: true,
174
- writable: true,
175
- value: void 0
176
- });
177
- Object.defineProperty(this, "assert", {
178
- enumerable: true,
179
- configurable: true,
180
- writable: true,
181
- value: void 0
182
- });
183
- Object.defineProperty(this, "extract", {
184
- enumerable: true,
185
- configurable: true,
186
- writable: true,
187
- value: void 0
188
- });
189
- Object.defineProperty(this, "postScript", {
190
- enumerable: true,
191
- configurable: true,
192
- writable: true,
193
- value: void 0
194
- });
195
- Object.defineProperty(this, "disabled", {
196
- enumerable: true,
197
- configurable: true,
198
- writable: true,
199
- value: void 0
200
- });
201
- Object.defineProperty(this, "timeout", {
202
- enumerable: true,
203
- configurable: true,
204
- writable: true,
205
- value: void 0
206
- });
207
- Object.defineProperty(this, "expectedStatus", {
208
- enumerable: true,
209
- configurable: true,
210
- writable: true,
211
- value: void 0
212
- });
213
- Object.defineProperty(this, "noRedirects", {
214
- enumerable: true,
215
- configurable: true,
216
- writable: true,
217
- value: void 0
218
- });
219
- Object.defineProperty(this, "meta", {
220
- enumerable: true,
221
- configurable: true,
222
- writable: true,
223
- value: void 0
224
- });
225
- }
226
- return LoadmillRequest;
227
- }());
228
- exports.LoadmillRequest = LoadmillRequest;
229
- var LoadmillOrFinfRequest = /** @class */ (function (_super) {
230
- __extends(LoadmillOrFinfRequest, _super);
231
- function LoadmillOrFinfRequest() {
232
- var _this = _super !== null && _super.apply(this, arguments) || this;
233
- Object.defineProperty(_this, "isFinfRequest", {
234
- enumerable: true,
235
- configurable: true,
236
- writable: true,
237
- value: void 0
238
- });
239
- return _this;
240
- }
241
- return LoadmillOrFinfRequest;
242
- }(LoadmillRequest));
243
- exports.LoadmillOrFinfRequest = LoadmillOrFinfRequest;
244
- function resolveUrl(url, parameters, onError) {
245
- return uriUtils.withProtocol(parameters_1.parameterUtils.resolveExpression(url, parameters, onError));
246
- }
247
- exports.resolveUrl = resolveUrl;
248
- /**
249
- * This function should be able to take any object/json and either make a VALID LoadmillRequest out of it
250
- * or fail with a meaningful error message.
251
- */
252
- function createRequest(from) {
253
- var id = from.id, url = from.url, delay = from.delay, assert = from.assert, method = from.method, timeout = from.timeout, extract = from.extract, headers = from.headers, postData = from.postData, postFormData = from.postFormData, graphqlPostData = from.graphqlPostData, file = from.file, stopBefore = from.stopBefore, skipBefore = from.skipBefore, loop = from.loop, description = from.description, expectedStatus = from.expectedStatus, postScript = from.postScript, disabled = from.disabled, noRedirects = from.noRedirects, meta = from.meta, grpc = from.grpc;
254
- var request = new LoadmillRequest(url);
255
- if (id) {
256
- request.id = id;
257
- }
258
- if (method) {
259
- request.method = method;
260
- }
261
- if (description) {
262
- request.description = description;
263
- }
264
- if (headers) {
265
- request.headers = toHeaders(headers);
266
- }
267
- if (postData) {
268
- request.postData = {
269
- text: postData.text,
270
- mimeType: postData.mimeType,
271
- params: postData.params
272
- };
273
- }
274
- if (postFormData) {
275
- request.postFormData = postFormData;
276
- }
277
- if (graphqlPostData) {
278
- request.graphqlPostData = graphqlPostData;
279
- }
280
- if (file) {
281
- request.file = file;
282
- }
283
- if (delay !== null && delay !== undefined) {
284
- request.delay = delay;
285
- }
286
- if (stopBefore !== undefined) {
287
- request.stopBefore = stopBefore;
288
- }
289
- if (skipBefore != null) {
290
- var goTo = skipBefore.goTo, negate = skipBefore.negate, condition = skipBefore.condition;
291
- request.skipBefore = {
292
- goTo: goTo,
293
- condition: condition,
294
- negate: !!negate,
295
- };
296
- }
297
- if (loop != null) {
298
- var iterations = loop.iterations, assert_1 = loop.assert, wait = loop.wait;
299
- var converted = toAssertions([assert_1])[0];
300
- request.loop = {
301
- assert: converted,
302
- iterations: iterations,
303
- wait: wait,
304
- };
305
- }
306
- if (timeout != null) {
307
- request.timeout = timeout;
308
- }
309
- if (extract) {
310
- request.extract = toExtractions(extract);
311
- }
312
- if (assert) {
313
- request.assert = toAssertions(assert);
314
- }
315
- if (expectedStatus) {
316
- request.expectedStatus = expectedStatus;
317
- }
318
- if (postScript !== undefined) {
319
- request.postScript = postScript;
320
- }
321
- if (disabled !== undefined) {
322
- request.disabled = disabled;
323
- }
324
- if (noRedirects !== undefined) {
325
- request.noRedirects = noRedirects;
326
- }
327
- if (meta) {
328
- request.meta = meta;
329
- }
330
- if (grpc) {
331
- request.grpc = grpc;
332
- }
333
- return request;
334
- }
335
- exports.createRequest = createRequest;
336
- function toHeaders(headers) {
337
- return flatMap(headers, function (value, key) {
338
- var res = [];
339
- if (typeof key === 'string') {
340
- pushHeader(value, key, res);
341
- }
342
- else {
343
- Object.keys(value).map(function (innerKey) {
344
- var innerValue = value[innerKey];
345
- pushHeader(innerValue, innerKey, res);
346
- });
347
- }
348
- return res;
349
- });
350
- }
351
- exports.toHeaders = toHeaders;
352
- function toExtractions(extractions) {
353
- if (!Array.isArray(extractions)) {
354
- extractions = [extractions];
355
- }
356
- return extractions.map(toSingleExtractions);
357
- }
358
- function toSingleExtractions(extractions) {
359
- var result = {};
360
- // Arrgh: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12449
361
- Object.keys(extractions).forEach(function (name) {
362
- var extraction = extractions[name];
363
- var newExtraction = extractions[name];
364
- if (typeof extraction !== 'string') {
365
- newExtraction = {};
366
- var header = extraction.header, jQuery = extraction.jQuery, xPath = extraction.xPath, jsonPath = extraction.jsonPath, edn = extraction.edn, regex = extraction.regex, ws = extraction.ws;
367
- if (header != null) {
368
- newExtraction.header = header;
369
- }
370
- if (jQuery != null) {
371
- newExtraction.jQuery =
372
- typeof jQuery === 'string'
373
- ? jQuery
374
- : { query: jQuery.query, attr: jQuery.attr };
375
- }
376
- if (xPath != null) {
377
- newExtraction.xPath = xPath;
378
- }
379
- if (jsonPath != null) {
380
- newExtraction.jsonPath = jsonPath;
381
- }
382
- if (edn != null) {
383
- newExtraction.edn = edn;
384
- }
385
- if (regex != null) {
386
- newExtraction.regex = regex;
387
- }
388
- if (ws != null) {
389
- newExtraction.ws = ws;
390
- }
391
- }
392
- result[name] = newExtraction;
393
- });
394
- return result;
395
- }
396
- function toAssertions(assertions) {
397
- var result = [];
398
- assertions.forEach(function (assertion, key) {
399
- var check = assertion.check, equals = assertion.equals, notEquals = assertion.notEquals, contains = assertion.contains, notContains = assertion.notContains, matches = assertion.matches, falsy = assertion.falsy, greater = assertion.greater, lesser = assertion.lesser, JSONSchema = assertion.JSONSchema, JSONContains = assertion.JSONContains, XMLContains = assertion.XMLContains;
400
- var converted = {
401
- check: check,
402
- };
403
- if (equals != null) {
404
- converted.equals = equals;
405
- }
406
- if (notEquals != null) {
407
- converted.notEquals = notEquals;
408
- }
409
- if (contains != null) {
410
- converted.contains = contains;
411
- }
412
- if (notContains != null) {
413
- converted.notContains = notContains;
414
- }
415
- if (matches != null) {
416
- converted.matches = matches;
417
- }
418
- if (greater != null) {
419
- converted.greater = greater;
420
- }
421
- if (lesser != null) {
422
- converted.lesser = lesser;
423
- }
424
- if (falsy != null && (falsy === 'true' || falsy === true)) {
425
- converted.falsy = true;
426
- }
427
- if (JSONSchema != null) {
428
- converted.JSONSchema = JSONSchema;
429
- }
430
- if (JSONContains != null) {
431
- converted.JSONContains = JSONContains;
432
- }
433
- if (XMLContains != null) {
434
- converted.XMLContains = XMLContains;
435
- }
436
- result[key] = converted;
437
- });
438
- return result;
439
- }
440
- function findRequestIndex(requests, desc) {
441
- return requests.findIndex(function (_a) {
442
- var description = _a.description;
443
- return description === desc;
444
- });
445
- }
446
- exports.findRequestIndex = findRequestIndex;
447
- function isReservedHeader(lowerName) {
448
- return (lowerName.startsWith('proxy-') ||
449
- (lowerName.startsWith('sec-') && !lowerName.startsWith('sec-websocket')) ||
450
- lowerName === 'accept-charset' ||
451
- lowerName === 'access-control-request-headers' ||
452
- lowerName === 'access-control-request-method' ||
453
- lowerName === 'connection' ||
454
- lowerName === 'content-length' ||
455
- lowerName === 'cookie2' ||
456
- lowerName === 'date' ||
457
- lowerName === 'dnt' ||
458
- lowerName === 'expect' ||
459
- lowerName === 'keep-alive' ||
460
- lowerName === 'te' ||
461
- lowerName === 'trailer' ||
462
- lowerName === 'transfer-encoding' ||
463
- lowerName === 'upgrade');
464
- }
465
- exports.isReservedHeader = isReservedHeader;
466
- function pushHeader(value, name, to) {
467
- to.push(singleton(value, name));
468
- }
469
- function singleton(value, name) {
470
- var _a;
471
- return _a = {}, _a[name] = value, _a;
472
- }
473
- var BodyTypes;
474
- (function (BodyTypes) {
475
- BodyTypes["POST_DATA"] = "postData";
476
- BodyTypes["URLENCODED"] = "urlencoded";
477
- BodyTypes["FORM_DATA"] = "postFormData";
478
- BodyTypes["RAW_FILE"] = "rawFile";
479
- BodyTypes["GRAPHQL"] = "GraphQL";
480
- })(BodyTypes = exports.BodyTypes || (exports.BodyTypes = {}));
481
- var CachePenetrationModes;
482
- (function (CachePenetrationModes) {
483
- CachePenetrationModes["none"] = "none";
484
- CachePenetrationModes["def"] = "default";
485
- CachePenetrationModes["alwaysQuery"] = "always-query";
486
- CachePenetrationModes["alwaysHeader"] = "always-header";
487
- })(CachePenetrationModes = exports.CachePenetrationModes || (exports.CachePenetrationModes = {}));
488
- // list of fields in our object we must not change
489
- exports.EXCLUDES = [
490
- 'url',
491
- 'method',
492
- 'headers',
493
- 'timeout',
494
- 'postData',
495
- 'text',
496
- 'mimeType',
497
- 'extract',
498
- 'jsonPath',
499
- 'jQuery',
500
- 'regex',
501
- 'header',
502
- 'assert',
503
- 'check',
504
- 'equals',
505
- 'contains',
506
- 'matches',
507
- 'falsy',
508
- 'greater',
509
- 'lesser',
510
- ];
511
- var isWSRequest = function (url) { return url.startsWith('ws://') || url.startsWith('wss://'); };
512
- exports.isWSRequest = isWSRequest;
513
- var isHTTPRequest = function (url) { return url.startsWith('http://') || url.startsWith('https://'); };
514
- exports.isHTTPRequest = isHTTPRequest;
515
- var isGRPCRequest = function (url) { return url.startsWith('grpc://'); };
516
- exports.isGRPCRequest = isGRPCRequest;
517
- var getResponseText = function (content) { return content.encoding === 'base64' ?
518
- Buffer.from(content.text || '', 'base64').toString('utf8')
519
- : content.text; };
520
- exports.getResponseText = getResponseText;
521
- var ConfMimeTypes;
522
- (function (ConfMimeTypes) {
523
- ConfMimeTypes["TEXT_PLAIN"] = "text/plain";
524
- ConfMimeTypes["APPLICATION_JSON"] = "application/json";
525
- ConfMimeTypes["APPLICATION_JAVASCRIPT"] = "application/javascript";
526
- ConfMimeTypes["APPLICATION_XML"] = "application/xml";
527
- ConfMimeTypes["APPLICATION_EDN"] = "application/edn";
528
- ConfMimeTypes["TEXT_XML"] = "text/xml";
529
- ConfMimeTypes["TEXT_HTML"] = "text/html";
530
- ConfMimeTypes["TEXT_CSS"] = "text/css";
531
- ConfMimeTypes["APPLICATION_URLENCODED"] = "application/x-www-form-urlencoded";
532
- })(ConfMimeTypes = exports.ConfMimeTypes || (exports.ConfMimeTypes = {}));
533
- var WsMessageType;
534
- (function (WsMessageType) {
535
- WsMessageType["TEXT"] = "text";
536
- WsMessageType["BINARY"] = "binary";
537
- })(WsMessageType = exports.WsMessageType || (exports.WsMessageType = {}));
538
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA2C;AAC3C,2EAA+D;AAC/D,4CAA2D;AAE9C,QAAA,uBAAuB,GAAG,K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AAb,qBAAa,KAAb,qBAAa,QAGtB"}
@@ -1,20 +0,0 @@
1
- export declare const generateJSONSchema: (jsObj: any, ignoreKeys?: string[], shouldAddNullable?: boolean, withExactValue?: boolean, withKeys?: boolean) => PrimitiveSchema | Schema;
2
- export declare const isPrimitive: (obj: any) => obj is Primitive;
3
- export declare const humanizeJsonSchemaErrors: (errors: any) => any;
4
- export declare const getField: (property: any, message?: string | undefined) => any;
5
- export declare const getJsonValidatorWithoutIgnoreKeys: (jsonValidator: any, ignoreKeys?: string[], shouldValidateArrays?: boolean) => string;
6
- export declare type Schema = BaseSchema & {
7
- properties?: {
8
- [name: string]: Schema | PrimitiveSchema;
9
- };
10
- items?: Schema[] | PrimitiveSchema[];
11
- };
12
- export declare type PrimitiveSchema = BaseSchema & {
13
- const?: Primitive;
14
- };
15
- declare type BaseSchema = {
16
- type?: string | string[];
17
- };
18
- declare type Primitive = string | number | boolean;
19
- export declare const ANY_VALUE = "*";
20
- export {};