bitsnap-react 1.5.0 → 1.6.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/models.d.ts CHANGED
@@ -6,6 +6,37 @@ declare namespace BitsnapModels {
6
6
  }, z.core.$strip>;
7
7
  type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;
8
8
  const MetadataSchema: z.ZodRecord<z.ZodString, z.ZodAny>;
9
+ const ProductPricingSchema: z.ZodObject<{
10
+ regularPrice: z.ZodNumber;
11
+ effectivePrice: z.ZodNumber;
12
+ currency: z.ZodString;
13
+ discount: z.ZodOptional<z.ZodObject<{
14
+ id: z.ZodString;
15
+ type: z.ZodEnum<{
16
+ FIXED: "FIXED";
17
+ PERCENTAGE: "PERCENTAGE";
18
+ }>;
19
+ value: z.ZodNumber;
20
+ status: z.ZodEnum<{
21
+ ACTIVE: "ACTIVE";
22
+ SCHEDULED: "SCHEDULED";
23
+ EXPIRED: "EXPIRED";
24
+ DISABLED: "DISABLED";
25
+ }>;
26
+ startsAt: z.ZodOptional<z.ZodNumber>;
27
+ endsAt: z.ZodOptional<z.ZodNumber>;
28
+ }, z.core.$strip>>;
29
+ referencePrice: z.ZodObject<{
30
+ amount: z.ZodOptional<z.ZodNumber>;
31
+ windowDays: z.ZodLiteral<30>;
32
+ asOf: z.ZodNumber;
33
+ basis: z.ZodLiteral<"observed-history">;
34
+ historyAvailable: z.ZodBoolean;
35
+ }, z.core.$strip>;
36
+ priceVersion: z.ZodString;
37
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
38
+ }, z.core.$strip>;
39
+ type ProductPricing = z.infer<typeof ProductPricingSchema>;
9
40
  const VariantSchema: z.ZodObject<{
10
41
  id: z.ZodString;
11
42
  name: z.ZodString;
@@ -16,6 +47,36 @@ declare namespace BitsnapModels {
16
47
  availableQuantity: z.ZodOptional<z.ZodNumber>;
17
48
  isDeliverable: z.ZodOptional<z.ZodBoolean>;
18
49
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
50
+ pricing: z.ZodOptional<z.ZodObject<{
51
+ regularPrice: z.ZodNumber;
52
+ effectivePrice: z.ZodNumber;
53
+ currency: z.ZodString;
54
+ discount: z.ZodOptional<z.ZodObject<{
55
+ id: z.ZodString;
56
+ type: z.ZodEnum<{
57
+ FIXED: "FIXED";
58
+ PERCENTAGE: "PERCENTAGE";
59
+ }>;
60
+ value: z.ZodNumber;
61
+ status: z.ZodEnum<{
62
+ ACTIVE: "ACTIVE";
63
+ SCHEDULED: "SCHEDULED";
64
+ EXPIRED: "EXPIRED";
65
+ DISABLED: "DISABLED";
66
+ }>;
67
+ startsAt: z.ZodOptional<z.ZodNumber>;
68
+ endsAt: z.ZodOptional<z.ZodNumber>;
69
+ }, z.core.$strip>>;
70
+ referencePrice: z.ZodObject<{
71
+ amount: z.ZodOptional<z.ZodNumber>;
72
+ windowDays: z.ZodLiteral<30>;
73
+ asOf: z.ZodNumber;
74
+ basis: z.ZodLiteral<"observed-history">;
75
+ historyAvailable: z.ZodBoolean;
76
+ }, z.core.$strip>;
77
+ priceVersion: z.ZodString;
78
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
79
+ }, z.core.$strip>>;
19
80
  }, z.core.$strip>;
20
81
  type Variant = z.infer<typeof VariantSchema>;
21
82
  const AdditionalSchema: z.ZodObject<{
@@ -57,8 +118,68 @@ declare namespace BitsnapModels {
57
118
  availableQuantity: z.ZodOptional<z.ZodNumber>;
58
119
  isDeliverable: z.ZodOptional<z.ZodBoolean>;
59
120
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
121
+ pricing: z.ZodOptional<z.ZodObject<{
122
+ regularPrice: z.ZodNumber;
123
+ effectivePrice: z.ZodNumber;
124
+ currency: z.ZodString;
125
+ discount: z.ZodOptional<z.ZodObject<{
126
+ id: z.ZodString;
127
+ type: z.ZodEnum<{
128
+ FIXED: "FIXED";
129
+ PERCENTAGE: "PERCENTAGE";
130
+ }>;
131
+ value: z.ZodNumber;
132
+ status: z.ZodEnum<{
133
+ ACTIVE: "ACTIVE";
134
+ SCHEDULED: "SCHEDULED";
135
+ EXPIRED: "EXPIRED";
136
+ DISABLED: "DISABLED";
137
+ }>;
138
+ startsAt: z.ZodOptional<z.ZodNumber>;
139
+ endsAt: z.ZodOptional<z.ZodNumber>;
140
+ }, z.core.$strip>>;
141
+ referencePrice: z.ZodObject<{
142
+ amount: z.ZodOptional<z.ZodNumber>;
143
+ windowDays: z.ZodLiteral<30>;
144
+ asOf: z.ZodNumber;
145
+ basis: z.ZodLiteral<"observed-history">;
146
+ historyAvailable: z.ZodBoolean;
147
+ }, z.core.$strip>;
148
+ priceVersion: z.ZodString;
149
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
150
+ }, z.core.$strip>>;
60
151
  }, z.core.$strip>>>;
61
152
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
153
+ pricing: z.ZodOptional<z.ZodObject<{
154
+ regularPrice: z.ZodNumber;
155
+ effectivePrice: z.ZodNumber;
156
+ currency: z.ZodString;
157
+ discount: z.ZodOptional<z.ZodObject<{
158
+ id: z.ZodString;
159
+ type: z.ZodEnum<{
160
+ FIXED: "FIXED";
161
+ PERCENTAGE: "PERCENTAGE";
162
+ }>;
163
+ value: z.ZodNumber;
164
+ status: z.ZodEnum<{
165
+ ACTIVE: "ACTIVE";
166
+ SCHEDULED: "SCHEDULED";
167
+ EXPIRED: "EXPIRED";
168
+ DISABLED: "DISABLED";
169
+ }>;
170
+ startsAt: z.ZodOptional<z.ZodNumber>;
171
+ endsAt: z.ZodOptional<z.ZodNumber>;
172
+ }, z.core.$strip>>;
173
+ referencePrice: z.ZodObject<{
174
+ amount: z.ZodOptional<z.ZodNumber>;
175
+ windowDays: z.ZodLiteral<30>;
176
+ asOf: z.ZodNumber;
177
+ basis: z.ZodLiteral<"observed-history">;
178
+ historyAvailable: z.ZodBoolean;
179
+ }, z.core.$strip>;
180
+ priceVersion: z.ZodString;
181
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
182
+ }, z.core.$strip>>;
62
183
  }, z.core.$strip>;
63
184
  type Item = z.infer<typeof ItemSchema>;
64
185
  const DataSchema: z.ZodObject<{
@@ -94,8 +215,68 @@ declare namespace BitsnapModels {
94
215
  availableQuantity: z.ZodOptional<z.ZodNumber>;
95
216
  isDeliverable: z.ZodOptional<z.ZodBoolean>;
96
217
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
218
+ pricing: z.ZodOptional<z.ZodObject<{
219
+ regularPrice: z.ZodNumber;
220
+ effectivePrice: z.ZodNumber;
221
+ currency: z.ZodString;
222
+ discount: z.ZodOptional<z.ZodObject<{
223
+ id: z.ZodString;
224
+ type: z.ZodEnum<{
225
+ FIXED: "FIXED";
226
+ PERCENTAGE: "PERCENTAGE";
227
+ }>;
228
+ value: z.ZodNumber;
229
+ status: z.ZodEnum<{
230
+ ACTIVE: "ACTIVE";
231
+ SCHEDULED: "SCHEDULED";
232
+ EXPIRED: "EXPIRED";
233
+ DISABLED: "DISABLED";
234
+ }>;
235
+ startsAt: z.ZodOptional<z.ZodNumber>;
236
+ endsAt: z.ZodOptional<z.ZodNumber>;
237
+ }, z.core.$strip>>;
238
+ referencePrice: z.ZodObject<{
239
+ amount: z.ZodOptional<z.ZodNumber>;
240
+ windowDays: z.ZodLiteral<30>;
241
+ asOf: z.ZodNumber;
242
+ basis: z.ZodLiteral<"observed-history">;
243
+ historyAvailable: z.ZodBoolean;
244
+ }, z.core.$strip>;
245
+ priceVersion: z.ZodString;
246
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
247
+ }, z.core.$strip>>;
97
248
  }, z.core.$strip>>>;
98
249
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
250
+ pricing: z.ZodOptional<z.ZodObject<{
251
+ regularPrice: z.ZodNumber;
252
+ effectivePrice: z.ZodNumber;
253
+ currency: z.ZodString;
254
+ discount: z.ZodOptional<z.ZodObject<{
255
+ id: z.ZodString;
256
+ type: z.ZodEnum<{
257
+ FIXED: "FIXED";
258
+ PERCENTAGE: "PERCENTAGE";
259
+ }>;
260
+ value: z.ZodNumber;
261
+ status: z.ZodEnum<{
262
+ ACTIVE: "ACTIVE";
263
+ SCHEDULED: "SCHEDULED";
264
+ EXPIRED: "EXPIRED";
265
+ DISABLED: "DISABLED";
266
+ }>;
267
+ startsAt: z.ZodOptional<z.ZodNumber>;
268
+ endsAt: z.ZodOptional<z.ZodNumber>;
269
+ }, z.core.$strip>>;
270
+ referencePrice: z.ZodObject<{
271
+ amount: z.ZodOptional<z.ZodNumber>;
272
+ windowDays: z.ZodLiteral<30>;
273
+ asOf: z.ZodNumber;
274
+ basis: z.ZodLiteral<"observed-history">;
275
+ historyAvailable: z.ZodBoolean;
276
+ }, z.core.$strip>;
277
+ priceVersion: z.ZodString;
278
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
279
+ }, z.core.$strip>>;
99
280
  }, z.core.$strip>>;
100
281
  totalCount: z.ZodNumber;
101
282
  }, z.core.$strip>;
@@ -134,8 +315,68 @@ declare namespace BitsnapModels {
134
315
  availableQuantity: z.ZodOptional<z.ZodNumber>;
135
316
  isDeliverable: z.ZodOptional<z.ZodBoolean>;
136
317
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
318
+ pricing: z.ZodOptional<z.ZodObject<{
319
+ regularPrice: z.ZodNumber;
320
+ effectivePrice: z.ZodNumber;
321
+ currency: z.ZodString;
322
+ discount: z.ZodOptional<z.ZodObject<{
323
+ id: z.ZodString;
324
+ type: z.ZodEnum<{
325
+ FIXED: "FIXED";
326
+ PERCENTAGE: "PERCENTAGE";
327
+ }>;
328
+ value: z.ZodNumber;
329
+ status: z.ZodEnum<{
330
+ ACTIVE: "ACTIVE";
331
+ SCHEDULED: "SCHEDULED";
332
+ EXPIRED: "EXPIRED";
333
+ DISABLED: "DISABLED";
334
+ }>;
335
+ startsAt: z.ZodOptional<z.ZodNumber>;
336
+ endsAt: z.ZodOptional<z.ZodNumber>;
337
+ }, z.core.$strip>>;
338
+ referencePrice: z.ZodObject<{
339
+ amount: z.ZodOptional<z.ZodNumber>;
340
+ windowDays: z.ZodLiteral<30>;
341
+ asOf: z.ZodNumber;
342
+ basis: z.ZodLiteral<"observed-history">;
343
+ historyAvailable: z.ZodBoolean;
344
+ }, z.core.$strip>;
345
+ priceVersion: z.ZodString;
346
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
347
+ }, z.core.$strip>>;
137
348
  }, z.core.$strip>>>;
138
349
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
350
+ pricing: z.ZodOptional<z.ZodObject<{
351
+ regularPrice: z.ZodNumber;
352
+ effectivePrice: z.ZodNumber;
353
+ currency: z.ZodString;
354
+ discount: z.ZodOptional<z.ZodObject<{
355
+ id: z.ZodString;
356
+ type: z.ZodEnum<{
357
+ FIXED: "FIXED";
358
+ PERCENTAGE: "PERCENTAGE";
359
+ }>;
360
+ value: z.ZodNumber;
361
+ status: z.ZodEnum<{
362
+ ACTIVE: "ACTIVE";
363
+ SCHEDULED: "SCHEDULED";
364
+ EXPIRED: "EXPIRED";
365
+ DISABLED: "DISABLED";
366
+ }>;
367
+ startsAt: z.ZodOptional<z.ZodNumber>;
368
+ endsAt: z.ZodOptional<z.ZodNumber>;
369
+ }, z.core.$strip>>;
370
+ referencePrice: z.ZodObject<{
371
+ amount: z.ZodOptional<z.ZodNumber>;
372
+ windowDays: z.ZodLiteral<30>;
373
+ asOf: z.ZodNumber;
374
+ basis: z.ZodLiteral<"observed-history">;
375
+ historyAvailable: z.ZodBoolean;
376
+ }, z.core.$strip>;
377
+ priceVersion: z.ZodString;
378
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
379
+ }, z.core.$strip>>;
139
380
  }, z.core.$strip>>;
140
381
  totalCount: z.ZodNumber;
141
382
  }, z.core.$strip>;
@@ -176,8 +417,68 @@ declare namespace BitsnapModels {
176
417
  availableQuantity: z.ZodOptional<z.ZodNumber>;
177
418
  isDeliverable: z.ZodOptional<z.ZodBoolean>;
178
419
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
420
+ pricing: z.ZodOptional<z.ZodObject<{
421
+ regularPrice: z.ZodNumber;
422
+ effectivePrice: z.ZodNumber;
423
+ currency: z.ZodString;
424
+ discount: z.ZodOptional<z.ZodObject<{
425
+ id: z.ZodString;
426
+ type: z.ZodEnum<{
427
+ FIXED: "FIXED";
428
+ PERCENTAGE: "PERCENTAGE";
429
+ }>;
430
+ value: z.ZodNumber;
431
+ status: z.ZodEnum<{
432
+ ACTIVE: "ACTIVE";
433
+ SCHEDULED: "SCHEDULED";
434
+ EXPIRED: "EXPIRED";
435
+ DISABLED: "DISABLED";
436
+ }>;
437
+ startsAt: z.ZodOptional<z.ZodNumber>;
438
+ endsAt: z.ZodOptional<z.ZodNumber>;
439
+ }, z.core.$strip>>;
440
+ referencePrice: z.ZodObject<{
441
+ amount: z.ZodOptional<z.ZodNumber>;
442
+ windowDays: z.ZodLiteral<30>;
443
+ asOf: z.ZodNumber;
444
+ basis: z.ZodLiteral<"observed-history">;
445
+ historyAvailable: z.ZodBoolean;
446
+ }, z.core.$strip>;
447
+ priceVersion: z.ZodString;
448
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
449
+ }, z.core.$strip>>;
179
450
  }, z.core.$strip>>>;
180
451
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
452
+ pricing: z.ZodOptional<z.ZodObject<{
453
+ regularPrice: z.ZodNumber;
454
+ effectivePrice: z.ZodNumber;
455
+ currency: z.ZodString;
456
+ discount: z.ZodOptional<z.ZodObject<{
457
+ id: z.ZodString;
458
+ type: z.ZodEnum<{
459
+ FIXED: "FIXED";
460
+ PERCENTAGE: "PERCENTAGE";
461
+ }>;
462
+ value: z.ZodNumber;
463
+ status: z.ZodEnum<{
464
+ ACTIVE: "ACTIVE";
465
+ SCHEDULED: "SCHEDULED";
466
+ EXPIRED: "EXPIRED";
467
+ DISABLED: "DISABLED";
468
+ }>;
469
+ startsAt: z.ZodOptional<z.ZodNumber>;
470
+ endsAt: z.ZodOptional<z.ZodNumber>;
471
+ }, z.core.$strip>>;
472
+ referencePrice: z.ZodObject<{
473
+ amount: z.ZodOptional<z.ZodNumber>;
474
+ windowDays: z.ZodLiteral<30>;
475
+ asOf: z.ZodNumber;
476
+ basis: z.ZodLiteral<"observed-history">;
477
+ historyAvailable: z.ZodBoolean;
478
+ }, z.core.$strip>;
479
+ priceVersion: z.ZodString;
480
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
481
+ }, z.core.$strip>>;
181
482
  }, z.core.$strip>>;
182
483
  totalCount: z.ZodNumber;
183
484
  }, z.core.$strip>;
@@ -220,8 +521,68 @@ declare namespace BitsnapModels {
220
521
  availableQuantity: z.ZodOptional<z.ZodNumber>;
221
522
  isDeliverable: z.ZodOptional<z.ZodBoolean>;
222
523
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
524
+ pricing: z.ZodOptional<z.ZodObject<{
525
+ regularPrice: z.ZodNumber;
526
+ effectivePrice: z.ZodNumber;
527
+ currency: z.ZodString;
528
+ discount: z.ZodOptional<z.ZodObject<{
529
+ id: z.ZodString;
530
+ type: z.ZodEnum<{
531
+ FIXED: "FIXED";
532
+ PERCENTAGE: "PERCENTAGE";
533
+ }>;
534
+ value: z.ZodNumber;
535
+ status: z.ZodEnum<{
536
+ ACTIVE: "ACTIVE";
537
+ SCHEDULED: "SCHEDULED";
538
+ EXPIRED: "EXPIRED";
539
+ DISABLED: "DISABLED";
540
+ }>;
541
+ startsAt: z.ZodOptional<z.ZodNumber>;
542
+ endsAt: z.ZodOptional<z.ZodNumber>;
543
+ }, z.core.$strip>>;
544
+ referencePrice: z.ZodObject<{
545
+ amount: z.ZodOptional<z.ZodNumber>;
546
+ windowDays: z.ZodLiteral<30>;
547
+ asOf: z.ZodNumber;
548
+ basis: z.ZodLiteral<"observed-history">;
549
+ historyAvailable: z.ZodBoolean;
550
+ }, z.core.$strip>;
551
+ priceVersion: z.ZodString;
552
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
553
+ }, z.core.$strip>>;
223
554
  }, z.core.$strip>>>;
224
555
  estimatedDeliveryAt: z.ZodOptional<z.ZodNumber>;
556
+ pricing: z.ZodOptional<z.ZodObject<{
557
+ regularPrice: z.ZodNumber;
558
+ effectivePrice: z.ZodNumber;
559
+ currency: z.ZodString;
560
+ discount: z.ZodOptional<z.ZodObject<{
561
+ id: z.ZodString;
562
+ type: z.ZodEnum<{
563
+ FIXED: "FIXED";
564
+ PERCENTAGE: "PERCENTAGE";
565
+ }>;
566
+ value: z.ZodNumber;
567
+ status: z.ZodEnum<{
568
+ ACTIVE: "ACTIVE";
569
+ SCHEDULED: "SCHEDULED";
570
+ EXPIRED: "EXPIRED";
571
+ DISABLED: "DISABLED";
572
+ }>;
573
+ startsAt: z.ZodOptional<z.ZodNumber>;
574
+ endsAt: z.ZodOptional<z.ZodNumber>;
575
+ }, z.core.$strip>>;
576
+ referencePrice: z.ZodObject<{
577
+ amount: z.ZodOptional<z.ZodNumber>;
578
+ windowDays: z.ZodLiteral<30>;
579
+ asOf: z.ZodNumber;
580
+ basis: z.ZodLiteral<"observed-history">;
581
+ historyAvailable: z.ZodBoolean;
582
+ }, z.core.$strip>;
583
+ priceVersion: z.ZodString;
584
+ nextPriceChangeAt: z.ZodOptional<z.ZodNumber>;
585
+ }, z.core.$strip>>;
225
586
  }, z.core.$strip>>;
226
587
  }, z.core.$strip>;
227
588
  }, z.core.$strip>;
package/dist/models.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.create;var z=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var x=(r,a)=>{for(var o in a)z(r,o,{get:a[o],enumerable:!0})},c=(r,a,o,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of b(a))!g.call(r,n)&&n!==o&&z(r,n,{get:()=>a[n],enumerable:!(i=s(a,n))||i.enumerable});return r};var h=(r,a,o)=>(o=r!=null?p(y(r)):{},c(a||!r||!r.__esModule?z(o,"default",{value:r,enumerable:!0}):o,r)),S=r=>c(z({},"__esModule",{value:!0}),r);var d={};x(d,{BitsnapModels:()=>l});module.exports=S(d);var e=h(require("zod")),l;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})}))))(l||={});
1
+ "use strict";var s=Object.create;var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var h=(r,o)=>{for(var a in o)c(r,a,{get:o[a],enumerable:!0})},l=(r,o,a,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of y(o))!f.call(r,n)&&n!==a&&c(r,n,{get:()=>o[n],enumerable:!(i=b(o,n))||i.enumerable});return r};var d=(r,o,a)=>(a=r!=null?s(g(r)):{},l(o||!r||!r.__esModule?c(a,"default",{value:r,enumerable:!0}):a,r)),x=r=>l(c({},"__esModule",{value:!0}),r);var P={};h(P,{BitsnapModels:()=>u});module.exports=x(P);var e=d(require("zod")),u;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.ProductPricingSchema=e.object({regularPrice:e.number(),effectivePrice:e.number(),currency:e.string(),discount:e.object({id:e.string(),type:e.enum(["FIXED","PERCENTAGE"]),value:e.number(),status:e.enum(["ACTIVE","SCHEDULED","EXPIRED","DISABLED"]),startsAt:e.number().optional(),endsAt:e.number().optional()}).optional(),referencePrice:e.object({amount:e.number().optional(),windowDays:e.literal(30),asOf:e.number(),basis:e.literal("observed-history"),historyAvailable:e.boolean()}),priceVersion:e.string(),nextPriceChangeAt:e.number().optional()}),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})}))))(u||={});
2
2
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/models.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,kBAEFF,OACFA,EAAA,uBAA2B,SAAO,CAC7C,UAAa,SAAO,EAAE,SAAS,CACjC,CAAC,EAGYA,EAAA,eAAmB,SAAS,SAAO,EAAK,MAAI,CAAC,EAE7CA,EAAA,cAAkB,SAAO,CACpC,GAAM,SAAO,EACb,KAAQ,SAAO,EACf,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,OAAU,QAAQ,SAAO,CAAC,EAC1B,kBAAqB,SAAO,EAAE,SAAS,EACvC,cAAiB,UAAQ,EAAE,SAAS,EACpC,oBAAuB,SAAO,EAAE,SAAS,CAC3C,CAAC,EAGYA,EAAA,iBAAqB,SAAO,CACvC,IAAO,SAAO,EAAE,SAAS,EACzB,iBAAkBA,EAAA,uBAAuB,SAAS,EAClD,UAAa,UAAQ,EAAE,SAAS,CAClC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,GAAM,SAAO,EACb,QAAW,SAAO,EAAE,SAAS,EAC7B,KAAQ,SAAO,EACf,YAAe,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAAE,SAAS,EACtD,UAAa,SAAO,EAAE,SAAS,EAC/B,UAAa,SAAO,EAAE,SAAS,EAC/B,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,UAAa,SAAO,EACpB,OAAU,QAAQ,SAAO,CAAC,EAC1B,cAAiB,UAAQ,EAAE,SAAS,EACpC,kBAAqB,SAAO,EAAE,SAAS,EACvC,WAAYA,EAAA,iBAAiB,SAAS,EACtC,SAAY,QAAMA,EAAA,aAAa,EAAE,SAAS,EAC1C,oBAAuB,SAAO,EAAE,SAAS,CAC3C,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,QAAW,UAAQ,EACnB,OAAU,QAAMA,EAAA,UAAU,EAC1B,WAAc,SAAO,CACvB,CAAC,EAGYA,EAAA,2BAA+B,SAAO,CACjD,KAAMA,EAAA,UACR,CAAC,EAGYA,EAAA,4BAAgC,QACzC,SAAO,CACP,OAAQA,EAAA,0BACV,CAAC,CACH,EAKaA,EAAA,oBAAwB,QACjC,SAAO,CACP,OAAU,SAAO,CACf,KAAQ,SAAO,CACb,QAAW,UAAQ,EACnB,QAAW,SAAO,EAAE,SAAS,EAC7B,OAAQA,EAAA,WAAW,SAAS,CAC9B,CAAC,CACH,CAAC,CACH,CAAC,CACH,IA/EeA,IAAA","names":["models_exports","__export","BitsnapModels","__toCommonJS","z"]}
1
+ {"version":3,"sources":["../src/models.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const ProductPricingSchema = z.object({\n regularPrice: z.number(),\n effectivePrice: z.number(),\n currency: z.string(),\n discount: z.object({\n id: z.string(),\n type: z.enum([\"FIXED\", \"PERCENTAGE\"]),\n value: z.number(),\n status: z.enum([\"ACTIVE\", \"SCHEDULED\", \"EXPIRED\", \"DISABLED\"]),\n startsAt: z.number().optional(),\n endsAt: z.number().optional(),\n }).optional(),\n referencePrice: z.object({\n amount: z.number().optional(),\n windowDays: z.literal(30),\n asOf: z.number(),\n basis: z.literal(\"observed-history\"),\n historyAvailable: z.boolean(),\n }),\n priceVersion: z.string(),\n nextPriceChangeAt: z.number().optional(),\n });\n export type ProductPricing = z.infer<typeof ProductPricingSchema>;\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,kBAEFF,OACFA,EAAA,uBAA2B,SAAO,CAC7C,UAAa,SAAO,EAAE,SAAS,CACjC,CAAC,EAGYA,EAAA,eAAmB,SAAS,SAAO,EAAK,MAAI,CAAC,EAE7CA,EAAA,qBAAyB,SAAO,CAC3C,aAAgB,SAAO,EACvB,eAAkB,SAAO,EACzB,SAAY,SAAO,EACnB,SAAY,SAAO,CACjB,GAAM,SAAO,EACb,KAAQ,OAAK,CAAC,QAAS,YAAY,CAAC,EACpC,MAAS,SAAO,EAChB,OAAU,OAAK,CAAC,SAAU,YAAa,UAAW,UAAU,CAAC,EAC7D,SAAY,SAAO,EAAE,SAAS,EAC9B,OAAU,SAAO,EAAE,SAAS,CAC9B,CAAC,EAAE,SAAS,EACZ,eAAkB,SAAO,CACvB,OAAU,SAAO,EAAE,SAAS,EAC5B,WAAc,UAAQ,EAAE,EACxB,KAAQ,SAAO,EACf,MAAS,UAAQ,kBAAkB,EACnC,iBAAoB,UAAQ,CAC9B,CAAC,EACD,aAAgB,SAAO,EACvB,kBAAqB,SAAO,EAAE,SAAS,CACzC,CAAC,EAGYA,EAAA,cAAkB,SAAO,CACpC,GAAM,SAAO,EACb,KAAQ,SAAO,EACf,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,OAAU,QAAQ,SAAO,CAAC,EAC1B,kBAAqB,SAAO,EAAE,SAAS,EACvC,cAAiB,UAAQ,EAAE,SAAS,EACpC,oBAAuB,SAAO,EAAE,SAAS,EACzC,QAASA,EAAA,qBAAqB,SAAS,CACzC,CAAC,EAGYA,EAAA,iBAAqB,SAAO,CACvC,IAAO,SAAO,EAAE,SAAS,EACzB,iBAAkBA,EAAA,uBAAuB,SAAS,EAClD,UAAa,UAAQ,EAAE,SAAS,CAClC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,GAAM,SAAO,EACb,QAAW,SAAO,EAAE,SAAS,EAC7B,KAAQ,SAAO,EACf,YAAe,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAAE,SAAS,EACtD,UAAa,SAAO,EAAE,SAAS,EAC/B,UAAa,SAAO,EAAE,SAAS,EAC/B,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,UAAa,SAAO,EACpB,OAAU,QAAQ,SAAO,CAAC,EAC1B,cAAiB,UAAQ,EAAE,SAAS,EACpC,kBAAqB,SAAO,EAAE,SAAS,EACvC,WAAYA,EAAA,iBAAiB,SAAS,EACtC,SAAY,QAAMA,EAAA,aAAa,EAAE,SAAS,EAC1C,oBAAuB,SAAO,EAAE,SAAS,EACzC,QAASA,EAAA,qBAAqB,SAAS,CACzC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,QAAW,UAAQ,EACnB,OAAU,QAAMA,EAAA,UAAU,EAC1B,WAAc,SAAO,CACvB,CAAC,EAGYA,EAAA,2BAA+B,SAAO,CACjD,KAAMA,EAAA,UACR,CAAC,EAGYA,EAAA,4BAAgC,QACzC,SAAO,CACP,OAAQA,EAAA,0BACV,CAAC,CACH,EAKaA,EAAA,oBAAwB,QACjC,SAAO,CACP,OAAU,SAAO,CACf,KAAQ,SAAO,CACb,QAAW,UAAQ,EACnB,QAAW,SAAO,EAAE,SAAS,EAC7B,OAAQA,EAAA,WAAW,SAAS,CAC9B,CAAC,CACH,CAAC,CACH,CAAC,CACH,IAzGeA,IAAA","names":["models_exports","__export","BitsnapModels","__toCommonJS","z"]}
package/dist/models.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import"./chunk-U6FLIRIV.mjs";import*as e from"zod";var l;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})}))))(l||={});export{l as BitsnapModels};
1
+ import"./chunk-U6FLIRIV.mjs";import*as e from"zod";var u;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.ProductPricingSchema=e.object({regularPrice:e.number(),effectivePrice:e.number(),currency:e.string(),discount:e.object({id:e.string(),type:e.enum(["FIXED","PERCENTAGE"]),value:e.number(),status:e.enum(["ACTIVE","SCHEDULED","EXPIRED","DISABLED"]),startsAt:e.number().optional(),endsAt:e.number().optional()}).optional(),referencePrice:e.object({amount:e.number().optional(),windowDays:e.literal(30),asOf:e.number(),basis:e.literal("observed-history"),historyAvailable:e.boolean()}),priceVersion:e.string(),nextPriceChangeAt:e.number().optional()}),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})}))))(u||={});export{u as BitsnapModels};
2
2
  //# sourceMappingURL=models.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/models.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n}\n"],"mappings":"6BAAA,UAAYA,MAAO,MAEZ,IAAUC,OACFA,EAAA,uBAA2B,SAAO,CAC7C,UAAa,SAAO,EAAE,SAAS,CACjC,CAAC,EAGYA,EAAA,eAAmB,SAAS,SAAO,EAAK,MAAI,CAAC,EAE7CA,EAAA,cAAkB,SAAO,CACpC,GAAM,SAAO,EACb,KAAQ,SAAO,EACf,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,OAAU,QAAQ,SAAO,CAAC,EAC1B,kBAAqB,SAAO,EAAE,SAAS,EACvC,cAAiB,UAAQ,EAAE,SAAS,EACpC,oBAAuB,SAAO,EAAE,SAAS,CAC3C,CAAC,EAGYA,EAAA,iBAAqB,SAAO,CACvC,IAAO,SAAO,EAAE,SAAS,EACzB,iBAAkBA,EAAA,uBAAuB,SAAS,EAClD,UAAa,UAAQ,EAAE,SAAS,CAClC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,GAAM,SAAO,EACb,QAAW,SAAO,EAAE,SAAS,EAC7B,KAAQ,SAAO,EACf,YAAe,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAAE,SAAS,EACtD,UAAa,SAAO,EAAE,SAAS,EAC/B,UAAa,SAAO,EAAE,SAAS,EAC/B,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,UAAa,SAAO,EACpB,OAAU,QAAQ,SAAO,CAAC,EAC1B,cAAiB,UAAQ,EAAE,SAAS,EACpC,kBAAqB,SAAO,EAAE,SAAS,EACvC,WAAYA,EAAA,iBAAiB,SAAS,EACtC,SAAY,QAAMA,EAAA,aAAa,EAAE,SAAS,EAC1C,oBAAuB,SAAO,EAAE,SAAS,CAC3C,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,QAAW,UAAQ,EACnB,OAAU,QAAMA,EAAA,UAAU,EAC1B,WAAc,SAAO,CACvB,CAAC,EAGYA,EAAA,2BAA+B,SAAO,CACjD,KAAMA,EAAA,UACR,CAAC,EAGYA,EAAA,4BAAgC,QACzC,SAAO,CACP,OAAQA,EAAA,0BACV,CAAC,CACH,EAKaA,EAAA,oBAAwB,QACjC,SAAO,CACP,OAAU,SAAO,CACf,KAAQ,SAAO,CACb,QAAW,UAAQ,EACnB,QAAW,SAAO,EAAE,SAAS,EAC7B,OAAQA,EAAA,WAAW,SAAS,CAC9B,CAAC,CACH,CAAC,CACH,CAAC,CACH,IA/EeA,IAAA","names":["z","BitsnapModels"]}
1
+ {"version":3,"sources":["../src/models.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const ProductPricingSchema = z.object({\n regularPrice: z.number(),\n effectivePrice: z.number(),\n currency: z.string(),\n discount: z.object({\n id: z.string(),\n type: z.enum([\"FIXED\", \"PERCENTAGE\"]),\n value: z.number(),\n status: z.enum([\"ACTIVE\", \"SCHEDULED\", \"EXPIRED\", \"DISABLED\"]),\n startsAt: z.number().optional(),\n endsAt: z.number().optional(),\n }).optional(),\n referencePrice: z.object({\n amount: z.number().optional(),\n windowDays: z.literal(30),\n asOf: z.number(),\n basis: z.literal(\"observed-history\"),\n historyAvailable: z.boolean(),\n }),\n priceVersion: z.string(),\n nextPriceChangeAt: z.number().optional(),\n });\n export type ProductPricing = z.infer<typeof ProductPricingSchema>;\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n}\n"],"mappings":"6BAAA,UAAYA,MAAO,MAEZ,IAAUC,OACFA,EAAA,uBAA2B,SAAO,CAC7C,UAAa,SAAO,EAAE,SAAS,CACjC,CAAC,EAGYA,EAAA,eAAmB,SAAS,SAAO,EAAK,MAAI,CAAC,EAE7CA,EAAA,qBAAyB,SAAO,CAC3C,aAAgB,SAAO,EACvB,eAAkB,SAAO,EACzB,SAAY,SAAO,EACnB,SAAY,SAAO,CACjB,GAAM,SAAO,EACb,KAAQ,OAAK,CAAC,QAAS,YAAY,CAAC,EACpC,MAAS,SAAO,EAChB,OAAU,OAAK,CAAC,SAAU,YAAa,UAAW,UAAU,CAAC,EAC7D,SAAY,SAAO,EAAE,SAAS,EAC9B,OAAU,SAAO,EAAE,SAAS,CAC9B,CAAC,EAAE,SAAS,EACZ,eAAkB,SAAO,CACvB,OAAU,SAAO,EAAE,SAAS,EAC5B,WAAc,UAAQ,EAAE,EACxB,KAAQ,SAAO,EACf,MAAS,UAAQ,kBAAkB,EACnC,iBAAoB,UAAQ,CAC9B,CAAC,EACD,aAAgB,SAAO,EACvB,kBAAqB,SAAO,EAAE,SAAS,CACzC,CAAC,EAGYA,EAAA,cAAkB,SAAO,CACpC,GAAM,SAAO,EACb,KAAQ,SAAO,EACf,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,OAAU,QAAQ,SAAO,CAAC,EAC1B,kBAAqB,SAAO,EAAE,SAAS,EACvC,cAAiB,UAAQ,EAAE,SAAS,EACpC,oBAAuB,SAAO,EAAE,SAAS,EACzC,QAASA,EAAA,qBAAqB,SAAS,CACzC,CAAC,EAGYA,EAAA,iBAAqB,SAAO,CACvC,IAAO,SAAO,EAAE,SAAS,EACzB,iBAAkBA,EAAA,uBAAuB,SAAS,EAClD,UAAa,UAAQ,EAAE,SAAS,CAClC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,GAAM,SAAO,EACb,QAAW,SAAO,EAAE,SAAS,EAC7B,KAAQ,SAAO,EACf,YAAe,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAAE,SAAS,EACtD,UAAa,SAAO,EAAE,SAAS,EAC/B,UAAa,SAAO,EAAE,SAAS,EAC/B,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,UAAa,SAAO,EACpB,OAAU,QAAQ,SAAO,CAAC,EAC1B,cAAiB,UAAQ,EAAE,SAAS,EACpC,kBAAqB,SAAO,EAAE,SAAS,EACvC,WAAYA,EAAA,iBAAiB,SAAS,EACtC,SAAY,QAAMA,EAAA,aAAa,EAAE,SAAS,EAC1C,oBAAuB,SAAO,EAAE,SAAS,EACzC,QAASA,EAAA,qBAAqB,SAAS,CACzC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,QAAW,UAAQ,EACnB,OAAU,QAAMA,EAAA,UAAU,EAC1B,WAAc,SAAO,CACvB,CAAC,EAGYA,EAAA,2BAA+B,SAAO,CACjD,KAAMA,EAAA,UACR,CAAC,EAGYA,EAAA,4BAAgC,QACzC,SAAO,CACP,OAAQA,EAAA,0BACV,CAAC,CACH,EAKaA,EAAA,oBAAwB,QACjC,SAAO,CACP,OAAU,SAAO,CACf,KAAQ,SAAO,CACb,QAAW,UAAQ,EACnB,QAAW,SAAO,EAAE,SAAS,EAC7B,OAAQA,EAAA,WAAW,SAAS,CAC9B,CAAC,CACH,CAAC,CACH,CAAC,CACH,IAzGeA,IAAA","names":["z","BitsnapModels"]}