univapay-node 4.0.172 → 4.0.174
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/dist/cjs/api/RestAPI.js +10 -7
- package/dist/cjs/api/RestAPI.js.map +1 -1
- package/dist/cjs/common/index.d.ts +1 -0
- package/dist/cjs/common/index.js +1 -0
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/types.d.ts +10 -0
- package/dist/cjs/common/types.js +3 -0
- package/dist/cjs/common/types.js.map +1 -0
- package/dist/cjs/errors/RequestResponseError.js +1 -1
- package/dist/cjs/resources/Cancels.d.ts +1 -1
- package/dist/cjs/resources/Charges.d.ts +1 -1
- package/dist/cjs/resources/ECFormLinks.d.ts +8 -8
- package/dist/cjs/resources/Merchants.d.ts +6 -6
- package/dist/cjs/resources/Refunds.d.ts +1 -1
- package/dist/cjs/resources/Subscriptions.d.ts +1 -1
- package/dist/cjs/resources/common/Configuration.d.ts +41 -41
- package/dist/cjs/resources/common/Configuration.js.map +1 -1
- package/dist/cjs/resources/common/ContactInfo.d.ts +2 -2
- package/dist/cjs/utils/object.js +1 -1
- package/dist/cjs/vendor/arrify.js +39 -0
- package/dist/cjs/vendor/change-case.js +171 -0
- package/dist/cjs/vendor/flat.js +128 -0
- package/dist/cjs/vendor/p-timeout.js +118 -0
- package/dist/cjs/vendor/query-string.js +632 -0
- package/dist/esm/api/RestAPI.js +7 -4
- package/dist/esm/api/RestAPI.js.map +1 -1
- package/dist/esm/common/index.d.ts +1 -0
- package/dist/esm/common/index.js +1 -0
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/types.d.ts +10 -0
- package/dist/esm/common/types.js +2 -0
- package/dist/esm/common/types.js.map +1 -0
- package/dist/esm/resources/Cancels.d.ts +1 -1
- package/dist/esm/resources/Charges.d.ts +1 -1
- package/dist/esm/resources/ECFormLinks.d.ts +8 -8
- package/dist/esm/resources/Merchants.d.ts +6 -6
- package/dist/esm/resources/Refunds.d.ts +1 -1
- package/dist/esm/resources/Subscriptions.d.ts +1 -1
- package/dist/esm/resources/common/Configuration.d.ts +41 -41
- package/dist/esm/resources/common/Configuration.js.map +1 -1
- package/dist/esm/resources/common/ContactInfo.d.ts +2 -2
- package/package.json +8 -8
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// node_modules/query-string/index.js
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
default: () => index_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
|
+
|
|
26
|
+
// node_modules/query-string/base.js
|
|
27
|
+
var base_exports = {};
|
|
28
|
+
__export(base_exports, {
|
|
29
|
+
exclude: () => exclude,
|
|
30
|
+
extract: () => extract,
|
|
31
|
+
parse: () => parse,
|
|
32
|
+
parseUrl: () => parseUrl,
|
|
33
|
+
pick: () => pick,
|
|
34
|
+
stringify: () => stringify,
|
|
35
|
+
stringifyUrl: () => stringifyUrl
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// node_modules/decode-uri-component/index.js
|
|
39
|
+
var token = "%[a-f0-9]{2}";
|
|
40
|
+
var multiMatcher = new RegExp(`(${token})+`, "gi");
|
|
41
|
+
var hexPair = /^[a-f\d]{2}$/i;
|
|
42
|
+
function parsePercentByte(input, position) {
|
|
43
|
+
if (input.codePointAt(position) !== 37 || position + 3 > input.length) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const digits = input.slice(position + 1, position + 3);
|
|
47
|
+
if (!hexPair.test(digits)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return { byte: Number.parseInt(digits, 16), next: position + 3 };
|
|
51
|
+
}
|
|
52
|
+
function utf8SequenceLength(byte) {
|
|
53
|
+
if (byte <= 127) {
|
|
54
|
+
return 1;
|
|
55
|
+
}
|
|
56
|
+
if (byte >= 194 && byte <= 223) {
|
|
57
|
+
return 2;
|
|
58
|
+
}
|
|
59
|
+
if (byte >= 224 && byte <= 239) {
|
|
60
|
+
return 3;
|
|
61
|
+
}
|
|
62
|
+
if (byte >= 240 && byte <= 244) {
|
|
63
|
+
return 4;
|
|
64
|
+
}
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
function isContinuationByte(byte) {
|
|
68
|
+
return byte >= 128 && byte <= 191;
|
|
69
|
+
}
|
|
70
|
+
function decode(input) {
|
|
71
|
+
try {
|
|
72
|
+
return decodeURIComponent(input);
|
|
73
|
+
} catch {
|
|
74
|
+
let output = "";
|
|
75
|
+
let position = 0;
|
|
76
|
+
while (position < input.length) {
|
|
77
|
+
if (input.codePointAt(position) !== 37) {
|
|
78
|
+
output += input.charAt(position);
|
|
79
|
+
position++;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const firstByte = parsePercentByte(input, position);
|
|
83
|
+
if (!firstByte) {
|
|
84
|
+
output += input.charAt(position);
|
|
85
|
+
position++;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const sequenceLength = utf8SequenceLength(firstByte.byte);
|
|
89
|
+
if (sequenceLength === 0) {
|
|
90
|
+
const pair = input.slice(position, position + 6);
|
|
91
|
+
if (pair === "%FE%FF" || pair === "%FF%FE") {
|
|
92
|
+
output += "\uFFFD\uFFFD";
|
|
93
|
+
position += 6;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
output += input.slice(position, position + 3);
|
|
97
|
+
position += 3;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
let end = firstByte.next;
|
|
101
|
+
let validSequence = true;
|
|
102
|
+
for (let index = 1; index < sequenceLength; index++) {
|
|
103
|
+
const nextByte = parsePercentByte(input, end);
|
|
104
|
+
if (!nextByte || !isContinuationByte(nextByte.byte)) {
|
|
105
|
+
validSequence = false;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
end = nextByte.next;
|
|
109
|
+
}
|
|
110
|
+
if (validSequence) {
|
|
111
|
+
const encodedSequence = input.slice(position, end);
|
|
112
|
+
try {
|
|
113
|
+
output += decodeURIComponent(encodedSequence);
|
|
114
|
+
position = end;
|
|
115
|
+
continue;
|
|
116
|
+
} catch {
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const literal = input.slice(position, position + 3);
|
|
120
|
+
output += literal === "%C2" ? "\uFFFD" : literal;
|
|
121
|
+
position += 3;
|
|
122
|
+
}
|
|
123
|
+
return output;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function customDecodeURIComponent(input) {
|
|
127
|
+
return input.replace(multiMatcher, (run) => decode(run));
|
|
128
|
+
}
|
|
129
|
+
function decodeUriComponent(encodedURI) {
|
|
130
|
+
if (typeof encodedURI !== "string") {
|
|
131
|
+
throw new TypeError(`Expected \`encodedURI\` to be of type \`string\`, got \`${typeof encodedURI}\``);
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
return decodeURIComponent(encodedURI);
|
|
135
|
+
} catch {
|
|
136
|
+
return customDecodeURIComponent(encodedURI);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// node_modules/filter-obj/index.js
|
|
141
|
+
function includeKeys(object, predicate) {
|
|
142
|
+
const result = {};
|
|
143
|
+
if (Array.isArray(predicate)) {
|
|
144
|
+
for (const key of predicate) {
|
|
145
|
+
const descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
146
|
+
if (descriptor?.enumerable) {
|
|
147
|
+
Object.defineProperty(result, key, descriptor);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
for (const key of Reflect.ownKeys(object)) {
|
|
152
|
+
const descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
153
|
+
if (descriptor.enumerable) {
|
|
154
|
+
const value = object[key];
|
|
155
|
+
if (predicate(key, value, object)) {
|
|
156
|
+
Object.defineProperty(result, key, descriptor);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// node_modules/split-on-first/index.js
|
|
165
|
+
function splitOnFirst(string, separator) {
|
|
166
|
+
if (!(typeof string === "string" && typeof separator === "string")) {
|
|
167
|
+
throw new TypeError("Expected the arguments to be of type `string`");
|
|
168
|
+
}
|
|
169
|
+
if (string === "" || separator === "") {
|
|
170
|
+
return [];
|
|
171
|
+
}
|
|
172
|
+
const separatorIndex = string.indexOf(separator);
|
|
173
|
+
if (separatorIndex === -1) {
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
return [
|
|
177
|
+
string.slice(0, separatorIndex),
|
|
178
|
+
string.slice(separatorIndex + separator.length)
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// node_modules/query-string/base.js
|
|
183
|
+
var isNullOrUndefined = (value) => value === null || value === void 0;
|
|
184
|
+
var strictUriEncode = (string) => encodeURIComponent(string).replaceAll(/[!'()*]/g, (x) => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
185
|
+
var encodeFragmentIdentifier = /* @__PURE__ */ Symbol("encodeFragmentIdentifier");
|
|
186
|
+
function encoderForArrayFormat(options) {
|
|
187
|
+
switch (options.arrayFormat) {
|
|
188
|
+
case "index": {
|
|
189
|
+
return (key) => (result, value) => {
|
|
190
|
+
const index = result.length;
|
|
191
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
if (value === null) {
|
|
195
|
+
result.push([encode(key, options), "[", index, "]"].join(""));
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
result.push([encode(key, options), "[", encode(index, options), "]=", encode(value, options)].join(""));
|
|
199
|
+
return result;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
case "bracket": {
|
|
203
|
+
return (key) => (result, value) => {
|
|
204
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
205
|
+
return result;
|
|
206
|
+
}
|
|
207
|
+
if (value === null) {
|
|
208
|
+
result.push([encode(key, options), "[]"].join(""));
|
|
209
|
+
return result;
|
|
210
|
+
}
|
|
211
|
+
result.push([encode(key, options), "[]=", encode(value, options)].join(""));
|
|
212
|
+
return result;
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
case "colon-list-separator": {
|
|
216
|
+
return (key) => (result, value) => {
|
|
217
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
if (value === null) {
|
|
221
|
+
result.push([encode(key, options), ":list="].join(""));
|
|
222
|
+
return result;
|
|
223
|
+
}
|
|
224
|
+
result.push([encode(key, options), ":list=", encode(value, options)].join(""));
|
|
225
|
+
return result;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
case "comma":
|
|
229
|
+
case "separator":
|
|
230
|
+
case "bracket-separator": {
|
|
231
|
+
const keyValueSeparator = options.arrayFormat === "bracket-separator" ? "[]=" : "=";
|
|
232
|
+
return (key) => (result, value) => {
|
|
233
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
value = value === null ? "" : value;
|
|
237
|
+
if (result.length === 0) {
|
|
238
|
+
result.push([encode(key, options), keyValueSeparator, encode(value, options)].join(""));
|
|
239
|
+
return result;
|
|
240
|
+
}
|
|
241
|
+
result.push(encode(value, options));
|
|
242
|
+
return result;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
default: {
|
|
246
|
+
return (key) => (result, value) => {
|
|
247
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
248
|
+
return result;
|
|
249
|
+
}
|
|
250
|
+
if (value === null) {
|
|
251
|
+
result.push(encode(key, options));
|
|
252
|
+
return result;
|
|
253
|
+
}
|
|
254
|
+
result.push([encode(key, options), "=", encode(value, options)].join(""));
|
|
255
|
+
return result;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function parserForArrayFormat(options) {
|
|
261
|
+
let result;
|
|
262
|
+
switch (options.arrayFormat) {
|
|
263
|
+
case "index": {
|
|
264
|
+
return (key, value, accumulator) => {
|
|
265
|
+
result = /\[(\d*)]$/.exec(key);
|
|
266
|
+
key = key.replace(/\[\d*]$/, "");
|
|
267
|
+
if (!result) {
|
|
268
|
+
accumulator[key] = value;
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (accumulator[key] === void 0) {
|
|
272
|
+
accumulator[key] = {};
|
|
273
|
+
}
|
|
274
|
+
accumulator[key][result[1]] = value;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
case "bracket": {
|
|
278
|
+
return (key, value, accumulator) => {
|
|
279
|
+
result = /(\[])$/.exec(key);
|
|
280
|
+
key = key.replace(/\[]$/, "");
|
|
281
|
+
if (!result) {
|
|
282
|
+
accumulator[key] = value;
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (accumulator[key] === void 0) {
|
|
286
|
+
accumulator[key] = [value];
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (!Array.isArray(accumulator[key])) {
|
|
290
|
+
accumulator[key] = [accumulator[key], value];
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
accumulator[key].push(value);
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
case "colon-list-separator": {
|
|
297
|
+
return (key, value, accumulator) => {
|
|
298
|
+
result = /(:list)$/.exec(key);
|
|
299
|
+
key = key.replace(/:list$/, "");
|
|
300
|
+
if (!result) {
|
|
301
|
+
accumulator[key] = value;
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (accumulator[key] === void 0) {
|
|
305
|
+
accumulator[key] = [value];
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (!Array.isArray(accumulator[key])) {
|
|
309
|
+
accumulator[key] = [accumulator[key], value];
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
accumulator[key].push(value);
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
case "comma":
|
|
316
|
+
case "separator": {
|
|
317
|
+
return (key, value, accumulator) => {
|
|
318
|
+
const isArray = typeof value === "string" && value.includes(options.arrayFormatSeparator);
|
|
319
|
+
const newValue = isArray ? value.split(options.arrayFormatSeparator).map((item) => decode2(item, options)) : value === null ? value : decode2(value, options);
|
|
320
|
+
accumulator[key] = newValue;
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
case "bracket-separator": {
|
|
324
|
+
return (key, value, accumulator) => {
|
|
325
|
+
const isArray = /(\[])$/.test(key);
|
|
326
|
+
key = key.replace(/\[]$/, "");
|
|
327
|
+
if (!isArray) {
|
|
328
|
+
accumulator[key] = value ? decode2(value, options) : value;
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const arrayValue = value === null ? [] : decode2(value, options).split(options.arrayFormatSeparator);
|
|
332
|
+
if (accumulator[key] === void 0) {
|
|
333
|
+
accumulator[key] = arrayValue;
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if (!Array.isArray(accumulator[key])) {
|
|
337
|
+
accumulator[key] = [accumulator[key]];
|
|
338
|
+
}
|
|
339
|
+
for (const item of arrayValue) {
|
|
340
|
+
accumulator[key].push(item);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
default: {
|
|
345
|
+
return (key, value, accumulator) => {
|
|
346
|
+
if (accumulator[key] === void 0) {
|
|
347
|
+
accumulator[key] = value;
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
if (Array.isArray(accumulator[key])) {
|
|
351
|
+
accumulator[key].push(value);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
accumulator[key] = [accumulator[key], value];
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function validateArrayFormatSeparator(value) {
|
|
360
|
+
if (typeof value !== "string" || value.length !== 1) {
|
|
361
|
+
throw new TypeError("arrayFormatSeparator must be single character string");
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function encode(value, options) {
|
|
365
|
+
if (options.encode) {
|
|
366
|
+
return options.strict ? strictUriEncode(value) : encodeURIComponent(value);
|
|
367
|
+
}
|
|
368
|
+
return value;
|
|
369
|
+
}
|
|
370
|
+
function decode2(value, options) {
|
|
371
|
+
if (options.decode) {
|
|
372
|
+
return decodeUriComponent(value);
|
|
373
|
+
}
|
|
374
|
+
return value;
|
|
375
|
+
}
|
|
376
|
+
function keysSorter(input) {
|
|
377
|
+
if (Array.isArray(input)) {
|
|
378
|
+
return input.sort();
|
|
379
|
+
}
|
|
380
|
+
if (typeof input === "object") {
|
|
381
|
+
return keysSorter(Object.keys(input)).sort((a, b) => Number(a) - Number(b)).map((key) => input[key]);
|
|
382
|
+
}
|
|
383
|
+
return input;
|
|
384
|
+
}
|
|
385
|
+
function removeHash(input) {
|
|
386
|
+
const hashStart = input.indexOf("#");
|
|
387
|
+
if (hashStart !== -1) {
|
|
388
|
+
input = input.slice(0, hashStart);
|
|
389
|
+
}
|
|
390
|
+
return input;
|
|
391
|
+
}
|
|
392
|
+
function getHash(url) {
|
|
393
|
+
let hash = "";
|
|
394
|
+
const hashStart = url.indexOf("#");
|
|
395
|
+
if (hashStart !== -1) {
|
|
396
|
+
hash = url.slice(hashStart);
|
|
397
|
+
}
|
|
398
|
+
return hash;
|
|
399
|
+
}
|
|
400
|
+
function getUrlWithoutQuery(url) {
|
|
401
|
+
const queryStart = url.indexOf("?");
|
|
402
|
+
return queryStart === -1 ? url : url.slice(0, queryStart);
|
|
403
|
+
}
|
|
404
|
+
function parseValue(value, options, type) {
|
|
405
|
+
if (type === "string" && typeof value === "string") {
|
|
406
|
+
return value;
|
|
407
|
+
}
|
|
408
|
+
if (typeof type === "function" && typeof value === "string") {
|
|
409
|
+
return type(value);
|
|
410
|
+
}
|
|
411
|
+
if (type === "boolean" && value === null) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
if (type === "boolean" && value !== null && (value.toLowerCase() === "true" || value.toLowerCase() === "false")) {
|
|
415
|
+
return value.toLowerCase() === "true";
|
|
416
|
+
}
|
|
417
|
+
if (type === "boolean" && value !== null && (value.toLowerCase() === "1" || value.toLowerCase() === "0")) {
|
|
418
|
+
return value.toLowerCase() === "1";
|
|
419
|
+
}
|
|
420
|
+
if (type === "string[]" && options.arrayFormat !== "none" && typeof value === "string") {
|
|
421
|
+
return [value];
|
|
422
|
+
}
|
|
423
|
+
if (type === "number[]" && options.arrayFormat !== "none" && !Number.isNaN(Number(value)) && (typeof value === "string" && value.trim() !== "")) {
|
|
424
|
+
return [Number(value)];
|
|
425
|
+
}
|
|
426
|
+
if (type === "number" && !Number.isNaN(Number(value)) && (typeof value === "string" && value.trim() !== "")) {
|
|
427
|
+
return Number(value);
|
|
428
|
+
}
|
|
429
|
+
if (options.parseBooleans && value !== null && (value.toLowerCase() === "true" || value.toLowerCase() === "false")) {
|
|
430
|
+
return value.toLowerCase() === "true";
|
|
431
|
+
}
|
|
432
|
+
if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === "string" && value.trim() !== "")) {
|
|
433
|
+
return Number(value);
|
|
434
|
+
}
|
|
435
|
+
return value;
|
|
436
|
+
}
|
|
437
|
+
function extract(input) {
|
|
438
|
+
input = removeHash(input);
|
|
439
|
+
const queryStart = input.indexOf("?");
|
|
440
|
+
if (queryStart === -1) {
|
|
441
|
+
return "";
|
|
442
|
+
}
|
|
443
|
+
return input.slice(queryStart + 1);
|
|
444
|
+
}
|
|
445
|
+
function parse(query, options) {
|
|
446
|
+
options = {
|
|
447
|
+
decode: true,
|
|
448
|
+
sort: true,
|
|
449
|
+
arrayFormat: "none",
|
|
450
|
+
arrayFormatSeparator: ",",
|
|
451
|
+
parseNumbers: false,
|
|
452
|
+
parseBooleans: false,
|
|
453
|
+
types: /* @__PURE__ */ Object.create(null),
|
|
454
|
+
...options
|
|
455
|
+
};
|
|
456
|
+
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
457
|
+
const formatter = parserForArrayFormat(options);
|
|
458
|
+
const returnValue = /* @__PURE__ */ Object.create(null);
|
|
459
|
+
if (typeof query !== "string") {
|
|
460
|
+
return returnValue;
|
|
461
|
+
}
|
|
462
|
+
query = query.trim().replace(/^[?#&]/, "");
|
|
463
|
+
if (!query) {
|
|
464
|
+
return returnValue;
|
|
465
|
+
}
|
|
466
|
+
if (/^&+$/.test(query)) {
|
|
467
|
+
return returnValue;
|
|
468
|
+
}
|
|
469
|
+
let parameterStart = 0;
|
|
470
|
+
let firstSeparator = query.indexOf("&");
|
|
471
|
+
if (firstSeparator === -1) {
|
|
472
|
+
firstSeparator = query.length;
|
|
473
|
+
}
|
|
474
|
+
for (let index = firstSeparator; index <= query.length; index++) {
|
|
475
|
+
if (index < query.length && query[index] !== "&") {
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
if (index === parameterStart) {
|
|
479
|
+
parameterStart = index + 1;
|
|
480
|
+
continue;
|
|
481
|
+
}
|
|
482
|
+
const parameter = query.slice(parameterStart, index);
|
|
483
|
+
const parameter_ = options.decode ? parameter.replaceAll("+", " ") : parameter;
|
|
484
|
+
let [key, value] = splitOnFirst(parameter_, "=");
|
|
485
|
+
if (key === void 0) {
|
|
486
|
+
key = parameter_;
|
|
487
|
+
}
|
|
488
|
+
value = value === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(options.arrayFormat) ? value : decode2(value, options);
|
|
489
|
+
formatter(decode2(key, options), value, returnValue);
|
|
490
|
+
parameterStart = index + 1;
|
|
491
|
+
}
|
|
492
|
+
for (const [key, value] of Object.entries(returnValue)) {
|
|
493
|
+
if (typeof value === "object" && value !== null && options.types[key] !== "string") {
|
|
494
|
+
for (const [key2, value2] of Object.entries(value)) {
|
|
495
|
+
const typeOption = options.types[key];
|
|
496
|
+
const type = typeof typeOption === "function" ? typeOption : typeOption ? typeOption.replace("[]", "") : void 0;
|
|
497
|
+
value[key2] = parseValue(value2, options, type);
|
|
498
|
+
}
|
|
499
|
+
} else if (typeof value === "object" && value !== null && options.types[key] === "string") {
|
|
500
|
+
returnValue[key] = Object.values(value).join(options.arrayFormatSeparator);
|
|
501
|
+
} else {
|
|
502
|
+
returnValue[key] = parseValue(value, options, options.types[key]);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
if (options.sort === false) {
|
|
506
|
+
return returnValue;
|
|
507
|
+
}
|
|
508
|
+
return (options.sort === true ? Object.keys(returnValue).sort() : Object.keys(returnValue).sort(options.sort)).reduce((result, key) => {
|
|
509
|
+
const value = returnValue[key];
|
|
510
|
+
result[key] = Boolean(value) && typeof value === "object" && !Array.isArray(value) ? keysSorter(value) : value;
|
|
511
|
+
return result;
|
|
512
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
513
|
+
}
|
|
514
|
+
function stringify(object, options) {
|
|
515
|
+
if (!object) {
|
|
516
|
+
return "";
|
|
517
|
+
}
|
|
518
|
+
options = {
|
|
519
|
+
encode: true,
|
|
520
|
+
strict: true,
|
|
521
|
+
arrayFormat: "none",
|
|
522
|
+
arrayFormatSeparator: ",",
|
|
523
|
+
...options
|
|
524
|
+
};
|
|
525
|
+
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
526
|
+
const shouldFilter = (key) => options.skipNull && isNullOrUndefined(object[key]) || options.skipEmptyString && object[key] === "";
|
|
527
|
+
const formatter = encoderForArrayFormat(options);
|
|
528
|
+
const objectCopy = {};
|
|
529
|
+
for (const [key, value] of Object.entries(object)) {
|
|
530
|
+
if (!shouldFilter(key)) {
|
|
531
|
+
objectCopy[key] = value;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
const keys = Object.keys(objectCopy);
|
|
535
|
+
if (options.sort !== false) {
|
|
536
|
+
keys.sort(options.sort);
|
|
537
|
+
}
|
|
538
|
+
return keys.map((key) => {
|
|
539
|
+
let value = object[key];
|
|
540
|
+
if (options.replacer) {
|
|
541
|
+
value = options.replacer(key, value);
|
|
542
|
+
if (value === void 0) {
|
|
543
|
+
return "";
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
if (value === void 0) {
|
|
547
|
+
return "";
|
|
548
|
+
}
|
|
549
|
+
if (value === null) {
|
|
550
|
+
return encode(key, options);
|
|
551
|
+
}
|
|
552
|
+
if (Array.isArray(value)) {
|
|
553
|
+
if (value.length === 0 && options.arrayFormat === "bracket-separator") {
|
|
554
|
+
return encode(key, options) + "[]";
|
|
555
|
+
}
|
|
556
|
+
let processedArray = value;
|
|
557
|
+
if (options.replacer) {
|
|
558
|
+
processedArray = value.map(
|
|
559
|
+
(item, index) => options.replacer(`${key}[${index}]`, item)
|
|
560
|
+
).filter((item) => item !== void 0);
|
|
561
|
+
}
|
|
562
|
+
const result = processedArray.reduce(formatter(key), []);
|
|
563
|
+
const arrayFormatSeparator = ["comma", "separator", "bracket-separator"].includes(options.arrayFormat) ? options.arrayFormatSeparator : "&";
|
|
564
|
+
return result.join(arrayFormatSeparator);
|
|
565
|
+
}
|
|
566
|
+
return encode(key, options) + "=" + encode(value, options);
|
|
567
|
+
}).filter((x) => x.length > 0).join("&");
|
|
568
|
+
}
|
|
569
|
+
function parseUrl(url, options) {
|
|
570
|
+
options = {
|
|
571
|
+
decode: true,
|
|
572
|
+
...options
|
|
573
|
+
};
|
|
574
|
+
let [url_, hash] = splitOnFirst(url, "#");
|
|
575
|
+
if (url_ === void 0) {
|
|
576
|
+
url_ = url;
|
|
577
|
+
}
|
|
578
|
+
return {
|
|
579
|
+
url: getUrlWithoutQuery(url_ ?? ""),
|
|
580
|
+
query: parse(extract(url), options),
|
|
581
|
+
...options && options.parseFragmentIdentifier && hash ? { fragmentIdentifier: decode2(hash, options) } : {}
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
function stringifyUrl(object, options) {
|
|
585
|
+
options = {
|
|
586
|
+
encode: true,
|
|
587
|
+
strict: true,
|
|
588
|
+
[encodeFragmentIdentifier]: true,
|
|
589
|
+
...options
|
|
590
|
+
};
|
|
591
|
+
const url = getUrlWithoutQuery(removeHash(object.url)) || "";
|
|
592
|
+
const queryFromUrl = extract(object.url);
|
|
593
|
+
const query = {
|
|
594
|
+
...parse(queryFromUrl, { sort: false, ...options }),
|
|
595
|
+
...object.query
|
|
596
|
+
};
|
|
597
|
+
let queryString = stringify(query, options);
|
|
598
|
+
queryString && (queryString = `?${queryString}`);
|
|
599
|
+
let hash = getHash(object.url);
|
|
600
|
+
if (typeof object.fragmentIdentifier === "string") {
|
|
601
|
+
hash = `#${object.fragmentIdentifier}`;
|
|
602
|
+
if (options[encodeFragmentIdentifier]) {
|
|
603
|
+
const throwawayUrl = new URL("https://query-string.invalid");
|
|
604
|
+
throwawayUrl.hash = hash;
|
|
605
|
+
hash = throwawayUrl.hash;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
return `${url}${queryString}${hash}`;
|
|
609
|
+
}
|
|
610
|
+
function pick(input, filter, options) {
|
|
611
|
+
options = {
|
|
612
|
+
parseFragmentIdentifier: true,
|
|
613
|
+
[encodeFragmentIdentifier]: false,
|
|
614
|
+
...options
|
|
615
|
+
};
|
|
616
|
+
const { url, query, fragmentIdentifier } = parseUrl(input, options);
|
|
617
|
+
return stringifyUrl({
|
|
618
|
+
url,
|
|
619
|
+
query: includeKeys(query, filter),
|
|
620
|
+
fragmentIdentifier
|
|
621
|
+
}, options);
|
|
622
|
+
}
|
|
623
|
+
function exclude(input, filter, options) {
|
|
624
|
+
if (Array.isArray(filter)) {
|
|
625
|
+
const filterSet = new Set(filter);
|
|
626
|
+
return pick(input, (key) => !filterSet.has(key), options);
|
|
627
|
+
}
|
|
628
|
+
return pick(input, (key, value) => !filter(key, value), options);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
// node_modules/query-string/index.js
|
|
632
|
+
var index_default = base_exports;
|
package/dist/esm/api/RestAPI.js
CHANGED
|
@@ -5,7 +5,7 @@ import { stringify } from "@apimatic/json-bigint";
|
|
|
5
5
|
import { EventEmitter } from "events";
|
|
6
6
|
import pTimeout from "p-timeout";
|
|
7
7
|
import queryString from "query-string";
|
|
8
|
-
import flatten from "flat";
|
|
8
|
+
import { flatten } from "flat";
|
|
9
9
|
import { DEFAULT_ENDPOINT, ENV_KEY_APP_ID, ENV_KEY_APPLICATION_JWT, ENV_KEY_ENDPOINT, ENV_KEY_SECRET, getEnv, IDEMPOTENCY_KEY_HEADER, POLLING_INTERVAL, POLLING_TIMEOUT, MAX_INTERNAL_ERROR_RETRY, } from "../common/constants.js";
|
|
10
10
|
import { fromError } from "../errors/parser.js";
|
|
11
11
|
import { ResponseError } from "../errors/RequestResponseError.js";
|
|
@@ -203,9 +203,12 @@ export class RestAPI extends EventEmitter {
|
|
|
203
203
|
return repeater();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
return pTimeout(repeater(),
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
return pTimeout(repeater(), {
|
|
207
|
+
milliseconds: timeout,
|
|
208
|
+
fallback: () => {
|
|
209
|
+
timedOut = true;
|
|
210
|
+
throw new TimeoutError(timeout);
|
|
211
|
+
},
|
|
209
212
|
});
|
|
210
213
|
});
|
|
211
214
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestAPI.js","sourceRoot":"","sources":["../../../src/api/RestAPI.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,OAAO,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"RestAPI.js","sourceRoot":"","sources":["../../../src/api/RestAPI.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,wBAAwB,GAC3B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAA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