@deliverart/sdk-js-core 2.5.25 → 2.5.26
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/index.cjs +21 -1
- package/dist/index.js +21 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -59,6 +59,26 @@ var OutputValidationError = class extends Error {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
// src/ApiClient.ts
|
|
62
|
+
function serializeQueryValue(value) {
|
|
63
|
+
if (value && typeof value === "object") {
|
|
64
|
+
const maybeToString = value.toString;
|
|
65
|
+
if (typeof maybeToString === "function") {
|
|
66
|
+
const str = maybeToString.call(value);
|
|
67
|
+
if (!str.startsWith("[object")) {
|
|
68
|
+
return str;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (Array.isArray(value)) {
|
|
72
|
+
return value.map(serializeQueryValue);
|
|
73
|
+
}
|
|
74
|
+
const out = {};
|
|
75
|
+
for (const [k, v] of Object.entries(value)) {
|
|
76
|
+
out[k] = serializeQueryValue(v);
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
62
82
|
var AbstractApiRequest = class {
|
|
63
83
|
constructor(input, options) {
|
|
64
84
|
this.input = input;
|
|
@@ -111,7 +131,7 @@ function createApiClient(config) {
|
|
|
111
131
|
const headers = request.validateHeaders();
|
|
112
132
|
const url = new URL(request.getPath(), config.baseUrl);
|
|
113
133
|
if (query) {
|
|
114
|
-
const queryString = import_qs.default.stringify(query, {
|
|
134
|
+
const queryString = import_qs.default.stringify(serializeQueryValue(query), {
|
|
115
135
|
arrayFormat: "brackets",
|
|
116
136
|
skipNulls: true
|
|
117
137
|
});
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,26 @@ var OutputValidationError = class extends Error {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
// src/ApiClient.ts
|
|
23
|
+
function serializeQueryValue(value) {
|
|
24
|
+
if (value && typeof value === "object") {
|
|
25
|
+
const maybeToString = value.toString;
|
|
26
|
+
if (typeof maybeToString === "function") {
|
|
27
|
+
const str = maybeToString.call(value);
|
|
28
|
+
if (!str.startsWith("[object")) {
|
|
29
|
+
return str;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
return value.map(serializeQueryValue);
|
|
34
|
+
}
|
|
35
|
+
const out = {};
|
|
36
|
+
for (const [k, v] of Object.entries(value)) {
|
|
37
|
+
out[k] = serializeQueryValue(v);
|
|
38
|
+
}
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
23
43
|
var AbstractApiRequest = class {
|
|
24
44
|
constructor(input, options) {
|
|
25
45
|
this.input = input;
|
|
@@ -72,7 +92,7 @@ function createApiClient(config) {
|
|
|
72
92
|
const headers = request.validateHeaders();
|
|
73
93
|
const url = new URL(request.getPath(), config.baseUrl);
|
|
74
94
|
if (query) {
|
|
75
|
-
const queryString = qs.stringify(query, {
|
|
95
|
+
const queryString = qs.stringify(serializeQueryValue(query), {
|
|
76
96
|
arrayFormat: "brackets",
|
|
77
97
|
skipNulls: true
|
|
78
98
|
});
|
package/package.json
CHANGED