@deliverart/sdk-js-core 2.5.25 → 2.5.27

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 CHANGED
@@ -59,6 +59,30 @@ var OutputValidationError = class extends Error {
59
59
  };
60
60
 
61
61
  // src/ApiClient.ts
62
+ function serializeQueryValue(value) {
63
+ if (Array.isArray(value)) {
64
+ return value.map(serializeQueryValue);
65
+ }
66
+ if (value && typeof value === "object") {
67
+ const v = value;
68
+ if (typeof v.iri === "string") {
69
+ return v.iri;
70
+ }
71
+ const maybeToString = value.toString;
72
+ if (typeof maybeToString === "function") {
73
+ const str = maybeToString.call(value);
74
+ if (!str.startsWith("[object")) {
75
+ return str;
76
+ }
77
+ }
78
+ const out = {};
79
+ for (const [k, v2] of Object.entries(v)) {
80
+ out[k] = serializeQueryValue(v2);
81
+ }
82
+ return out;
83
+ }
84
+ return value;
85
+ }
62
86
  var AbstractApiRequest = class {
63
87
  constructor(input, options) {
64
88
  this.input = input;
@@ -111,7 +135,7 @@ function createApiClient(config) {
111
135
  const headers = request.validateHeaders();
112
136
  const url = new URL(request.getPath(), config.baseUrl);
113
137
  if (query) {
114
- const queryString = import_qs.default.stringify(query, {
138
+ const queryString = import_qs.default.stringify(serializeQueryValue(query), {
115
139
  arrayFormat: "brackets",
116
140
  skipNulls: true
117
141
  });
package/dist/index.js CHANGED
@@ -20,6 +20,30 @@ var OutputValidationError = class extends Error {
20
20
  };
21
21
 
22
22
  // src/ApiClient.ts
23
+ function serializeQueryValue(value) {
24
+ if (Array.isArray(value)) {
25
+ return value.map(serializeQueryValue);
26
+ }
27
+ if (value && typeof value === "object") {
28
+ const v = value;
29
+ if (typeof v.iri === "string") {
30
+ return v.iri;
31
+ }
32
+ const maybeToString = value.toString;
33
+ if (typeof maybeToString === "function") {
34
+ const str = maybeToString.call(value);
35
+ if (!str.startsWith("[object")) {
36
+ return str;
37
+ }
38
+ }
39
+ const out = {};
40
+ for (const [k, v2] of Object.entries(v)) {
41
+ out[k] = serializeQueryValue(v2);
42
+ }
43
+ return out;
44
+ }
45
+ return value;
46
+ }
23
47
  var AbstractApiRequest = class {
24
48
  constructor(input, options) {
25
49
  this.input = input;
@@ -72,7 +96,7 @@ function createApiClient(config) {
72
96
  const headers = request.validateHeaders();
73
97
  const url = new URL(request.getPath(), config.baseUrl);
74
98
  if (query) {
75
- const queryString = qs.stringify(query, {
99
+ const queryString = qs.stringify(serializeQueryValue(query), {
76
100
  arrayFormat: "brackets",
77
101
  skipNulls: true
78
102
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-core",
3
3
  "description": "Core SDK for DeliverArt, providing essential functionalities and utilities.",
4
- "version": "2.5.25",
4
+ "version": "2.5.27",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",