@deliverart/sdk-js-core 3.0.2-dev.0 → 3.0.2-dev.1
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 +7 -13
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +7 -13
- 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 && "iri"
|
|
279
|
+
return typeof input2 === "object" && input2 !== null && Object.prototype.hasOwnProperty.call(input2, "iri") && Object.prototype.hasOwnProperty.call(input2, "params") && Object.prototype.hasOwnProperty.call(input2, "__pattern") && serializedIriObjectSchema.safeParse(input2).success;
|
|
280
280
|
}
|
|
281
281
|
function deserializeIri(s) {
|
|
282
282
|
return new import_sdk_js_global_types2.IriObject(s.iri, s.__pattern);
|
|
@@ -287,19 +287,15 @@ function serializeForClient(input2) {
|
|
|
287
287
|
iri: input2.iri,
|
|
288
288
|
params: input2.params,
|
|
289
289
|
__pattern: input2.__pattern
|
|
290
|
-
// qui P è literal
|
|
291
290
|
};
|
|
292
291
|
}
|
|
293
292
|
if (Array.isArray(input2)) {
|
|
294
293
|
return input2.map((item) => serializeForClient(item));
|
|
295
294
|
}
|
|
296
295
|
if (input2 !== null && typeof input2 === "object") {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
result[key] = serializeForClient(value);
|
|
301
|
-
}
|
|
302
|
-
return result;
|
|
296
|
+
return Object.fromEntries(
|
|
297
|
+
Object.entries(input2).map(([key, value]) => [key, serializeForClient(value)])
|
|
298
|
+
);
|
|
303
299
|
}
|
|
304
300
|
return input2;
|
|
305
301
|
}
|
|
@@ -311,11 +307,9 @@ function deserializeFromClient(input2) {
|
|
|
311
307
|
return input2.map((item) => deserializeFromClient(item));
|
|
312
308
|
}
|
|
313
309
|
if (input2 !== null && typeof input2 === "object") {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
-
return result;
|
|
310
|
+
return Object.fromEntries(
|
|
311
|
+
Object.entries(input2).map(([key, value]) => [key, deserializeFromClient(value)])
|
|
312
|
+
);
|
|
319
313
|
}
|
|
320
314
|
return input2;
|
|
321
315
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -112,14 +112,16 @@ 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> ? IriObject<P> : T extends
|
|
115
|
+
type DeepDeserialized<T> = T extends SerializedIriObject<infer P> ? Exclude<keyof T, keyof SerializedIriObject> extends never ? IriObject<P> : T extends IriObject<P> ? IriObject<P> : {
|
|
116
|
+
[K in keyof T]: DeepDeserialized<T[K]>;
|
|
117
|
+
} : T extends Array<infer U> ? DeepDeserialized<U>[] : T extends object ? {
|
|
116
118
|
[K in keyof T]: DeepDeserialized<T[K]>;
|
|
117
119
|
} : T;
|
|
118
120
|
type DeepSerialized<T> = T extends IriObject<infer P> ? SerializedIriObject<P> : T extends Array<infer U> ? DeepSerialized<U>[] : T extends object ? {
|
|
119
121
|
[K in keyof T]: DeepSerialized<T[K]>;
|
|
120
122
|
} : T;
|
|
121
123
|
declare function serializeForClient<T>(input: T): DeepSerialized<T>;
|
|
122
|
-
declare function deserializeFromClient<T extends SerializedIriObject<P>, P extends string>(input: T):
|
|
124
|
+
declare function deserializeFromClient<T extends SerializedIriObject<P>, P extends string>(input: T): DeepDeserialized<T>;
|
|
123
125
|
declare function deserializeFromClient<T>(input: T): DeepDeserialized<T>;
|
|
124
126
|
|
|
125
127
|
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,14 +112,16 @@ 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> ? IriObject<P> : T extends
|
|
115
|
+
type DeepDeserialized<T> = T extends SerializedIriObject<infer P> ? Exclude<keyof T, keyof SerializedIriObject> extends never ? IriObject<P> : T extends IriObject<P> ? IriObject<P> : {
|
|
116
|
+
[K in keyof T]: DeepDeserialized<T[K]>;
|
|
117
|
+
} : T extends Array<infer U> ? DeepDeserialized<U>[] : T extends object ? {
|
|
116
118
|
[K in keyof T]: DeepDeserialized<T[K]>;
|
|
117
119
|
} : T;
|
|
118
120
|
type DeepSerialized<T> = T extends IriObject<infer P> ? SerializedIriObject<P> : T extends Array<infer U> ? DeepSerialized<U>[] : T extends object ? {
|
|
119
121
|
[K in keyof T]: DeepSerialized<T[K]>;
|
|
120
122
|
} : T;
|
|
121
123
|
declare function serializeForClient<T>(input: T): DeepSerialized<T>;
|
|
122
|
-
declare function deserializeFromClient<T extends SerializedIriObject<P>, P extends string>(input: T):
|
|
124
|
+
declare function deserializeFromClient<T extends SerializedIriObject<P>, P extends string>(input: T): DeepDeserialized<T>;
|
|
123
125
|
declare function deserializeFromClient<T>(input: T): DeepDeserialized<T>;
|
|
124
126
|
|
|
125
127
|
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 && "iri"
|
|
237
|
+
return typeof input2 === "object" && input2 !== null && Object.prototype.hasOwnProperty.call(input2, "iri") && Object.prototype.hasOwnProperty.call(input2, "params") && Object.prototype.hasOwnProperty.call(input2, "__pattern") && serializedIriObjectSchema.safeParse(input2).success;
|
|
238
238
|
}
|
|
239
239
|
function deserializeIri(s) {
|
|
240
240
|
return new IriObject(s.iri, s.__pattern);
|
|
@@ -245,19 +245,15 @@ function serializeForClient(input2) {
|
|
|
245
245
|
iri: input2.iri,
|
|
246
246
|
params: input2.params,
|
|
247
247
|
__pattern: input2.__pattern
|
|
248
|
-
// qui P è literal
|
|
249
248
|
};
|
|
250
249
|
}
|
|
251
250
|
if (Array.isArray(input2)) {
|
|
252
251
|
return input2.map((item) => serializeForClient(item));
|
|
253
252
|
}
|
|
254
253
|
if (input2 !== null && typeof input2 === "object") {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
result[key] = serializeForClient(value);
|
|
259
|
-
}
|
|
260
|
-
return result;
|
|
254
|
+
return Object.fromEntries(
|
|
255
|
+
Object.entries(input2).map(([key, value]) => [key, serializeForClient(value)])
|
|
256
|
+
);
|
|
261
257
|
}
|
|
262
258
|
return input2;
|
|
263
259
|
}
|
|
@@ -269,11 +265,9 @@ function deserializeFromClient(input2) {
|
|
|
269
265
|
return input2.map((item) => deserializeFromClient(item));
|
|
270
266
|
}
|
|
271
267
|
if (input2 !== null && typeof input2 === "object") {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
return result;
|
|
268
|
+
return Object.fromEntries(
|
|
269
|
+
Object.entries(input2).map(([key, value]) => [key, deserializeFromClient(value)])
|
|
270
|
+
);
|
|
277
271
|
}
|
|
278
272
|
return input2;
|
|
279
273
|
}
|
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-dev.
|
|
4
|
+
"version": "3.0.2-dev.1",
|
|
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-dev.
|
|
26
|
+
"@deliverart/sdk-js-global-types": "3.0.2-dev.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/qs": "^6.15.1",
|