@deliverart/sdk-js-core 3.0.2-dev.1 → 3.0.2
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 +13 -7
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +13 -7
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -276,7 +276,7 @@ var serializedIriObjectSchema = import_zod2.z.object({
|
|
|
276
276
|
__pattern: import_zod2.z.string().min(1)
|
|
277
277
|
}).strict();
|
|
278
278
|
function isSerializedIriObject(input2) {
|
|
279
|
-
return typeof input2 === "object" && input2 !== null &&
|
|
279
|
+
return typeof input2 === "object" && input2 !== null && "iri" in input2 && "params" in input2 && "__pattern" in input2 && typeof input2.iri === "string" && typeof input2.__pattern === "string" && typeof input2.params === "object";
|
|
280
280
|
}
|
|
281
281
|
function deserializeIri(s) {
|
|
282
282
|
return new import_sdk_js_global_types2.IriObject(s.iri, s.__pattern);
|
|
@@ -287,15 +287,19 @@ function serializeForClient(input2) {
|
|
|
287
287
|
iri: input2.iri,
|
|
288
288
|
params: input2.params,
|
|
289
289
|
__pattern: input2.__pattern
|
|
290
|
+
// qui P è literal
|
|
290
291
|
};
|
|
291
292
|
}
|
|
292
293
|
if (Array.isArray(input2)) {
|
|
293
294
|
return input2.map((item) => serializeForClient(item));
|
|
294
295
|
}
|
|
295
296
|
if (input2 !== null && typeof input2 === "object") {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
const result = {};
|
|
298
|
+
for (const key in input2) {
|
|
299
|
+
const value = input2[key];
|
|
300
|
+
result[key] = serializeForClient(value);
|
|
301
|
+
}
|
|
302
|
+
return result;
|
|
299
303
|
}
|
|
300
304
|
return input2;
|
|
301
305
|
}
|
|
@@ -307,9 +311,11 @@ function deserializeFromClient(input2) {
|
|
|
307
311
|
return input2.map((item) => deserializeFromClient(item));
|
|
308
312
|
}
|
|
309
313
|
if (input2 !== null && typeof input2 === "object") {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
314
|
+
const result = {};
|
|
315
|
+
for (const key in input2) {
|
|
316
|
+
result[key] = deserializeFromClient(input2[key]);
|
|
317
|
+
}
|
|
318
|
+
return result;
|
|
313
319
|
}
|
|
314
320
|
return input2;
|
|
315
321
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -112,16 +112,14 @@ type SerializedIriObject<TPattern extends string = string> = {
|
|
|
112
112
|
params: Record<string, string>;
|
|
113
113
|
__pattern: TPattern;
|
|
114
114
|
};
|
|
115
|
-
type DeepDeserialized<T> = T extends SerializedIriObject<infer P> ?
|
|
116
|
-
[K in keyof T]: DeepDeserialized<T[K]>;
|
|
117
|
-
} : T extends Array<infer U> ? DeepDeserialized<U>[] : T extends object ? {
|
|
115
|
+
type DeepDeserialized<T> = T extends SerializedIriObject<infer P> ? IriObject<P> : T extends Array<infer U> ? DeepDeserialized<U>[] : T extends object ? {
|
|
118
116
|
[K in keyof T]: DeepDeserialized<T[K]>;
|
|
119
117
|
} : T;
|
|
120
118
|
type DeepSerialized<T> = T extends IriObject<infer P> ? SerializedIriObject<P> : T extends Array<infer U> ? DeepSerialized<U>[] : T extends object ? {
|
|
121
119
|
[K in keyof T]: DeepSerialized<T[K]>;
|
|
122
120
|
} : T;
|
|
123
121
|
declare function serializeForClient<T>(input: T): DeepSerialized<T>;
|
|
124
|
-
declare function deserializeFromClient<T extends SerializedIriObject<P>, P extends string>(input: T):
|
|
122
|
+
declare function deserializeFromClient<T extends SerializedIriObject<P>, P extends string>(input: T): IriObject<P>;
|
|
125
123
|
declare function deserializeFromClient<T>(input: T): DeepDeserialized<T>;
|
|
126
124
|
|
|
127
125
|
export { AbstractApiRequest, type ApiClient, type ApiClientPlugin, type ApiExtension, type DeepDeserialized, type DeepSerialized, InputValidationError, OutputValidationError, type SerializedIriObject, type UnpaginatedResponse, createApiClient, deserializeFromClient, serializeForClient, serializedIriObjectSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -112,16 +112,14 @@ type SerializedIriObject<TPattern extends string = string> = {
|
|
|
112
112
|
params: Record<string, string>;
|
|
113
113
|
__pattern: TPattern;
|
|
114
114
|
};
|
|
115
|
-
type DeepDeserialized<T> = T extends SerializedIriObject<infer P> ?
|
|
116
|
-
[K in keyof T]: DeepDeserialized<T[K]>;
|
|
117
|
-
} : T extends Array<infer U> ? DeepDeserialized<U>[] : T extends object ? {
|
|
115
|
+
type DeepDeserialized<T> = T extends SerializedIriObject<infer P> ? IriObject<P> : T extends Array<infer U> ? DeepDeserialized<U>[] : T extends object ? {
|
|
118
116
|
[K in keyof T]: DeepDeserialized<T[K]>;
|
|
119
117
|
} : T;
|
|
120
118
|
type DeepSerialized<T> = T extends IriObject<infer P> ? SerializedIriObject<P> : T extends Array<infer U> ? DeepSerialized<U>[] : T extends object ? {
|
|
121
119
|
[K in keyof T]: DeepSerialized<T[K]>;
|
|
122
120
|
} : T;
|
|
123
121
|
declare function serializeForClient<T>(input: T): DeepSerialized<T>;
|
|
124
|
-
declare function deserializeFromClient<T extends SerializedIriObject<P>, P extends string>(input: T):
|
|
122
|
+
declare function deserializeFromClient<T extends SerializedIriObject<P>, P extends string>(input: T): IriObject<P>;
|
|
125
123
|
declare function deserializeFromClient<T>(input: T): DeepDeserialized<T>;
|
|
126
124
|
|
|
127
125
|
export { AbstractApiRequest, type ApiClient, type ApiClientPlugin, type ApiExtension, type DeepDeserialized, type DeepSerialized, InputValidationError, OutputValidationError, type SerializedIriObject, type UnpaginatedResponse, createApiClient, deserializeFromClient, serializeForClient, serializedIriObjectSchema };
|
package/dist/index.js
CHANGED
|
@@ -234,7 +234,7 @@ var serializedIriObjectSchema = z2.object({
|
|
|
234
234
|
__pattern: z2.string().min(1)
|
|
235
235
|
}).strict();
|
|
236
236
|
function isSerializedIriObject(input2) {
|
|
237
|
-
return typeof input2 === "object" && input2 !== null &&
|
|
237
|
+
return typeof input2 === "object" && input2 !== null && "iri" in input2 && "params" in input2 && "__pattern" in input2 && typeof input2.iri === "string" && typeof input2.__pattern === "string" && typeof input2.params === "object";
|
|
238
238
|
}
|
|
239
239
|
function deserializeIri(s) {
|
|
240
240
|
return new IriObject(s.iri, s.__pattern);
|
|
@@ -245,15 +245,19 @@ function serializeForClient(input2) {
|
|
|
245
245
|
iri: input2.iri,
|
|
246
246
|
params: input2.params,
|
|
247
247
|
__pattern: input2.__pattern
|
|
248
|
+
// qui P è literal
|
|
248
249
|
};
|
|
249
250
|
}
|
|
250
251
|
if (Array.isArray(input2)) {
|
|
251
252
|
return input2.map((item) => serializeForClient(item));
|
|
252
253
|
}
|
|
253
254
|
if (input2 !== null && typeof input2 === "object") {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
const result = {};
|
|
256
|
+
for (const key in input2) {
|
|
257
|
+
const value = input2[key];
|
|
258
|
+
result[key] = serializeForClient(value);
|
|
259
|
+
}
|
|
260
|
+
return result;
|
|
257
261
|
}
|
|
258
262
|
return input2;
|
|
259
263
|
}
|
|
@@ -265,9 +269,11 @@ function deserializeFromClient(input2) {
|
|
|
265
269
|
return input2.map((item) => deserializeFromClient(item));
|
|
266
270
|
}
|
|
267
271
|
if (input2 !== null && typeof input2 === "object") {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
272
|
+
const result = {};
|
|
273
|
+
for (const key in input2) {
|
|
274
|
+
result[key] = deserializeFromClient(input2[key]);
|
|
275
|
+
}
|
|
276
|
+
return result;
|
|
271
277
|
}
|
|
272
278
|
return input2;
|
|
273
279
|
}
|
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": "3.0.2
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"qs": "6.16.1",
|
|
25
25
|
"zod": "4.6.6",
|
|
26
|
-
"@deliverart/sdk-js-global-types": "3.0.2
|
|
26
|
+
"@deliverart/sdk-js-global-types": "3.0.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/qs": "^6.15.1",
|