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.
Files changed (42) hide show
  1. package/dist/cjs/api/RestAPI.js +10 -7
  2. package/dist/cjs/api/RestAPI.js.map +1 -1
  3. package/dist/cjs/common/index.d.ts +1 -0
  4. package/dist/cjs/common/index.js +1 -0
  5. package/dist/cjs/common/index.js.map +1 -1
  6. package/dist/cjs/common/types.d.ts +10 -0
  7. package/dist/cjs/common/types.js +3 -0
  8. package/dist/cjs/common/types.js.map +1 -0
  9. package/dist/cjs/errors/RequestResponseError.js +1 -1
  10. package/dist/cjs/resources/Cancels.d.ts +1 -1
  11. package/dist/cjs/resources/Charges.d.ts +1 -1
  12. package/dist/cjs/resources/ECFormLinks.d.ts +8 -8
  13. package/dist/cjs/resources/Merchants.d.ts +6 -6
  14. package/dist/cjs/resources/Refunds.d.ts +1 -1
  15. package/dist/cjs/resources/Subscriptions.d.ts +1 -1
  16. package/dist/cjs/resources/common/Configuration.d.ts +41 -41
  17. package/dist/cjs/resources/common/Configuration.js.map +1 -1
  18. package/dist/cjs/resources/common/ContactInfo.d.ts +2 -2
  19. package/dist/cjs/utils/object.js +1 -1
  20. package/dist/cjs/vendor/arrify.js +39 -0
  21. package/dist/cjs/vendor/change-case.js +171 -0
  22. package/dist/cjs/vendor/flat.js +128 -0
  23. package/dist/cjs/vendor/p-timeout.js +118 -0
  24. package/dist/cjs/vendor/query-string.js +632 -0
  25. package/dist/esm/api/RestAPI.js +7 -4
  26. package/dist/esm/api/RestAPI.js.map +1 -1
  27. package/dist/esm/common/index.d.ts +1 -0
  28. package/dist/esm/common/index.js +1 -0
  29. package/dist/esm/common/index.js.map +1 -1
  30. package/dist/esm/common/types.d.ts +10 -0
  31. package/dist/esm/common/types.js +2 -0
  32. package/dist/esm/common/types.js.map +1 -0
  33. package/dist/esm/resources/Cancels.d.ts +1 -1
  34. package/dist/esm/resources/Charges.d.ts +1 -1
  35. package/dist/esm/resources/ECFormLinks.d.ts +8 -8
  36. package/dist/esm/resources/Merchants.d.ts +6 -6
  37. package/dist/esm/resources/Refunds.d.ts +1 -1
  38. package/dist/esm/resources/Subscriptions.d.ts +1 -1
  39. package/dist/esm/resources/common/Configuration.d.ts +41 -41
  40. package/dist/esm/resources/common/Configuration.js.map +1 -1
  41. package/dist/esm/resources/common/ContactInfo.d.ts +2 -2
  42. package/package.json +8 -8
@@ -0,0 +1,171 @@
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/change-case/dist/index.js
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ camelCase: () => camelCase,
23
+ capitalCase: () => capitalCase,
24
+ constantCase: () => constantCase,
25
+ dotCase: () => dotCase,
26
+ kebabCase: () => kebabCase,
27
+ noCase: () => noCase,
28
+ pascalCase: () => pascalCase,
29
+ pascalSnakeCase: () => pascalSnakeCase,
30
+ pathCase: () => pathCase,
31
+ sentenceCase: () => sentenceCase,
32
+ snakeCase: () => snakeCase,
33
+ split: () => split,
34
+ splitSeparateNumbers: () => splitSeparateNumbers,
35
+ trainCase: () => trainCase
36
+ });
37
+ module.exports = __toCommonJS(index_exports);
38
+ var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
39
+ var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
40
+ var SPLIT_SEPARATE_NUMBER_RE = /(\d)\p{Ll}|(\p{L})\d/u;
41
+ var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
42
+ var SPLIT_REPLACE_VALUE = "$1\0$2";
43
+ var DEFAULT_PREFIX_SUFFIX_CHARACTERS = "";
44
+ function split(value) {
45
+ let result = value.trim();
46
+ result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
47
+ result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
48
+ let start = 0;
49
+ let end = result.length;
50
+ while (result.charAt(start) === "\0")
51
+ start++;
52
+ if (start === end)
53
+ return [];
54
+ while (result.charAt(end - 1) === "\0")
55
+ end--;
56
+ return result.slice(start, end).split(/\0/g);
57
+ }
58
+ function splitSeparateNumbers(value) {
59
+ const words = split(value);
60
+ for (let i = 0; i < words.length; i++) {
61
+ const word = words[i];
62
+ const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);
63
+ if (match) {
64
+ const offset = match.index + (match[1] ?? match[2]).length;
65
+ words.splice(i, 1, word.slice(0, offset), word.slice(offset));
66
+ }
67
+ }
68
+ return words;
69
+ }
70
+ function noCase(input, options) {
71
+ const [prefix, words, suffix] = splitPrefixSuffix(input, options);
72
+ return prefix + words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? " ") + suffix;
73
+ }
74
+ function camelCase(input, options) {
75
+ const [prefix, words, suffix] = splitPrefixSuffix(input, options);
76
+ const lower = lowerFactory(options?.locale);
77
+ const upper = upperFactory(options?.locale);
78
+ const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
79
+ return prefix + words.map((word, index) => {
80
+ if (index === 0)
81
+ return lower(word);
82
+ return transform(word, index);
83
+ }).join(options?.delimiter ?? "") + suffix;
84
+ }
85
+ function pascalCase(input, options) {
86
+ const [prefix, words, suffix] = splitPrefixSuffix(input, options);
87
+ const lower = lowerFactory(options?.locale);
88
+ const upper = upperFactory(options?.locale);
89
+ const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
90
+ return prefix + words.map(transform).join(options?.delimiter ?? "") + suffix;
91
+ }
92
+ function pascalSnakeCase(input, options) {
93
+ return capitalCase(input, { delimiter: "_", ...options });
94
+ }
95
+ function capitalCase(input, options) {
96
+ const [prefix, words, suffix] = splitPrefixSuffix(input, options);
97
+ const lower = lowerFactory(options?.locale);
98
+ const upper = upperFactory(options?.locale);
99
+ return prefix + words.map(capitalCaseTransformFactory(lower, upper)).join(options?.delimiter ?? " ") + suffix;
100
+ }
101
+ function constantCase(input, options) {
102
+ const [prefix, words, suffix] = splitPrefixSuffix(input, options);
103
+ return prefix + words.map(upperFactory(options?.locale)).join(options?.delimiter ?? "_") + suffix;
104
+ }
105
+ function dotCase(input, options) {
106
+ return noCase(input, { delimiter: ".", ...options });
107
+ }
108
+ function kebabCase(input, options) {
109
+ return noCase(input, { delimiter: "-", ...options });
110
+ }
111
+ function pathCase(input, options) {
112
+ return noCase(input, { delimiter: "/", ...options });
113
+ }
114
+ function sentenceCase(input, options) {
115
+ const [prefix, words, suffix] = splitPrefixSuffix(input, options);
116
+ const lower = lowerFactory(options?.locale);
117
+ const upper = upperFactory(options?.locale);
118
+ const transform = capitalCaseTransformFactory(lower, upper);
119
+ return prefix + words.map((word, index) => {
120
+ if (index === 0)
121
+ return transform(word);
122
+ return lower(word);
123
+ }).join(options?.delimiter ?? " ") + suffix;
124
+ }
125
+ function snakeCase(input, options) {
126
+ return noCase(input, { delimiter: "_", ...options });
127
+ }
128
+ function trainCase(input, options) {
129
+ return capitalCase(input, { delimiter: "-", ...options });
130
+ }
131
+ function lowerFactory(locale) {
132
+ return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
133
+ }
134
+ function upperFactory(locale) {
135
+ return locale === false ? (input) => input.toUpperCase() : (input) => input.toLocaleUpperCase(locale);
136
+ }
137
+ function capitalCaseTransformFactory(lower, upper) {
138
+ return (word) => `${upper(word[0])}${lower(word.slice(1))}`;
139
+ }
140
+ function pascalCaseTransformFactory(lower, upper) {
141
+ return (word, index) => {
142
+ const char0 = word[0];
143
+ const initial = index > 0 && char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
144
+ return initial + lower(word.slice(1));
145
+ };
146
+ }
147
+ function splitPrefixSuffix(input, options = {}) {
148
+ const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);
149
+ const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
150
+ const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
151
+ let prefixIndex = 0;
152
+ let suffixIndex = input.length;
153
+ while (prefixIndex < input.length) {
154
+ const char = input.charAt(prefixIndex);
155
+ if (!prefixCharacters.includes(char))
156
+ break;
157
+ prefixIndex++;
158
+ }
159
+ while (suffixIndex > prefixIndex) {
160
+ const index = suffixIndex - 1;
161
+ const char = input.charAt(index);
162
+ if (!suffixCharacters.includes(char))
163
+ break;
164
+ suffixIndex = index;
165
+ }
166
+ return [
167
+ input.slice(0, prefixIndex),
168
+ splitFn(input.slice(prefixIndex, suffixIndex)),
169
+ input.slice(suffixIndex)
170
+ ];
171
+ }
@@ -0,0 +1,128 @@
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/flat/index.js
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ flatten: () => flatten,
23
+ unflatten: () => unflatten
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ function isBuffer(obj) {
27
+ return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
28
+ }
29
+ function keyIdentity(key) {
30
+ return key;
31
+ }
32
+ function flatten(target, opts) {
33
+ opts = opts || {};
34
+ const delimiter = opts.delimiter || ".";
35
+ const maxDepth = opts.maxDepth;
36
+ const transformKey = opts.transformKey || keyIdentity;
37
+ const output = {};
38
+ function step(object, prev, currentDepth) {
39
+ currentDepth = currentDepth || 1;
40
+ Object.keys(object).forEach(function(key) {
41
+ const value = object[key];
42
+ const isarray = opts.safe && Array.isArray(value);
43
+ const type = Object.prototype.toString.call(value);
44
+ const isbuffer = isBuffer(value);
45
+ const isobject = type === "[object Object]" || type === "[object Array]";
46
+ const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
47
+ if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) {
48
+ return step(value, newKey, currentDepth + 1);
49
+ }
50
+ output[newKey] = value;
51
+ });
52
+ }
53
+ step(target);
54
+ return output;
55
+ }
56
+ function unflatten(target, opts) {
57
+ opts = opts || {};
58
+ const delimiter = opts.delimiter || ".";
59
+ const overwrite = opts.overwrite || false;
60
+ const transformKey = opts.transformKey || keyIdentity;
61
+ const result = {};
62
+ const isbuffer = isBuffer(target);
63
+ if (isbuffer || Object.prototype.toString.call(target) !== "[object Object]") {
64
+ return target;
65
+ }
66
+ function getkey(key) {
67
+ const parsedKey = Number(key);
68
+ return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
69
+ }
70
+ function addKeys(keyPrefix, recipient, target2) {
71
+ return Object.keys(target2).reduce(function(result2, key) {
72
+ result2[keyPrefix + delimiter + key] = target2[key];
73
+ return result2;
74
+ }, recipient);
75
+ }
76
+ function isEmpty(val) {
77
+ const type = Object.prototype.toString.call(val);
78
+ const isArray = type === "[object Array]";
79
+ const isObject = type === "[object Object]";
80
+ if (!val) {
81
+ return true;
82
+ } else if (isArray) {
83
+ return !val.length;
84
+ } else if (isObject) {
85
+ return !Object.keys(val).length;
86
+ }
87
+ }
88
+ target = Object.keys(target).reduce(function(result2, key) {
89
+ const type = Object.prototype.toString.call(target[key]);
90
+ const isObject = type === "[object Object]" || type === "[object Array]";
91
+ if (!isObject || isEmpty(target[key])) {
92
+ result2[key] = target[key];
93
+ return result2;
94
+ } else {
95
+ return addKeys(
96
+ key,
97
+ result2,
98
+ flatten(target[key], opts)
99
+ );
100
+ }
101
+ }, {});
102
+ Object.keys(target).forEach(function(key) {
103
+ const split = key.split(delimiter).map(transformKey);
104
+ let key1 = getkey(split.shift());
105
+ let key2 = getkey(split[0]);
106
+ let recipient = result;
107
+ while (key2 !== void 0) {
108
+ if (key1 === "__proto__") {
109
+ return;
110
+ }
111
+ const type = Object.prototype.toString.call(recipient[key1]);
112
+ const isobject = type === "[object Object]" || type === "[object Array]";
113
+ if (!overwrite && !isobject && typeof recipient[key1] !== "undefined") {
114
+ return;
115
+ }
116
+ if (overwrite && !isobject || !overwrite && recipient[key1] == null) {
117
+ recipient[key1] = typeof key2 === "number" && !opts.object ? [] : {};
118
+ }
119
+ recipient = recipient[key1];
120
+ if (split.length > 0) {
121
+ key1 = getkey(split.shift());
122
+ key2 = getkey(split[0]);
123
+ }
124
+ }
125
+ recipient[key1] = unflatten(target[key], opts);
126
+ });
127
+ return result;
128
+ }
@@ -0,0 +1,118 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
20
+
21
+ // node_modules/p-timeout/index.js
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ TimeoutError: () => TimeoutError,
25
+ default: () => pTimeout
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+ var TimeoutError = class _TimeoutError extends Error {
29
+ constructor(message, options) {
30
+ super(message, options);
31
+ __publicField(this, "name", "TimeoutError");
32
+ Error.captureStackTrace?.(this, _TimeoutError);
33
+ }
34
+ };
35
+ var getAbortedReason = (signal) => "reason" in signal ? signal.reason : new DOMException("This operation was aborted.", "AbortError");
36
+ var maximumDelay = 2 ** 31 - 1;
37
+ var getOptionsError = (milliseconds, customTimers) => {
38
+ if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
39
+ return new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
40
+ }
41
+ if (typeof customTimers?.setTimeout !== "function" || typeof customTimers?.clearTimeout !== "function") {
42
+ return new TypeError("Expected `customTimers` to have a `setTimeout` and a `clearTimeout` function");
43
+ }
44
+ };
45
+ function pTimeout(promise, options) {
46
+ const {
47
+ milliseconds,
48
+ fallback,
49
+ message,
50
+ customTimers = { setTimeout, clearTimeout },
51
+ signal
52
+ } = options;
53
+ let timer;
54
+ let abortHandler;
55
+ const cancelInput = () => {
56
+ try {
57
+ promise.cancel?.();
58
+ } catch {
59
+ }
60
+ };
61
+ const wrappedPromise = new Promise((resolve, reject) => {
62
+ const abort = () => {
63
+ reject(getAbortedReason(signal));
64
+ cancelInput();
65
+ };
66
+ const optionsError = getOptionsError(milliseconds, customTimers);
67
+ try {
68
+ if (optionsError) {
69
+ reject(optionsError);
70
+ } else if (signal?.aborted) {
71
+ abort();
72
+ } else if (signal) {
73
+ abortHandler = abort;
74
+ signal.addEventListener("abort", abortHandler, { once: true });
75
+ }
76
+ } finally {
77
+ promise.then(resolve, reject);
78
+ }
79
+ if (optionsError || signal?.aborted || milliseconds > maximumDelay) {
80
+ return;
81
+ }
82
+ const timeoutError = fallback || message === false || message instanceof Error ? void 0 : new TimeoutError(message ?? `Promise timed out after ${milliseconds} milliseconds`);
83
+ timer = customTimers.setTimeout.call(void 0, () => {
84
+ if (fallback) {
85
+ try {
86
+ resolve(fallback());
87
+ } catch (error) {
88
+ reject(error);
89
+ }
90
+ } else if (message === false) {
91
+ resolve();
92
+ } else {
93
+ reject(message instanceof Error ? message : timeoutError);
94
+ }
95
+ cancelInput();
96
+ }, milliseconds);
97
+ });
98
+ const cancelablePromise = wrappedPromise.finally(() => {
99
+ try {
100
+ cancelablePromise.clear();
101
+ } catch {
102
+ }
103
+ try {
104
+ if (abortHandler) {
105
+ signal.removeEventListener("abort", abortHandler);
106
+ }
107
+ } catch {
108
+ }
109
+ });
110
+ cancelablePromise.clear = () => {
111
+ if (timer === void 0) {
112
+ return;
113
+ }
114
+ customTimers.clearTimeout.call(void 0, timer);
115
+ timer = void 0;
116
+ };
117
+ return cancelablePromise;
118
+ }