@wix/auto_sdk_stores_inventory 1.0.65 → 1.0.66
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/build/cjs/index.d.ts +5 -15
- package/build/cjs/index.js +15 -256
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +5 -246
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +5 -15
- package/build/es/index.mjs +15 -246
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +5 -236
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +5 -15
- package/build/internal/cjs/index.js +15 -256
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.js +5 -246
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +5 -15
- package/build/internal/es/index.mjs +15 -246
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.mjs +5 -236
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +2 -2
package/build/es/index.mjs
CHANGED
|
@@ -286,222 +286,6 @@ function incrementInventory(payload) {
|
|
|
286
286
|
return __incrementInventory;
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
// src/stores-v2-inventory-inventory.schemas.ts
|
|
290
|
-
import * as z from "zod";
|
|
291
|
-
var GetInventoryVariantsRequest = z.object({
|
|
292
|
-
inventoryId: z.string().describe("Inventory item ID."),
|
|
293
|
-
options: z.intersection(
|
|
294
|
-
z.object({ variantIds: z.array(z.string()).optional() }),
|
|
295
|
-
z.xor([
|
|
296
|
-
z.object({
|
|
297
|
-
inventoryId: z.never().optional(),
|
|
298
|
-
externalId: z.never().optional(),
|
|
299
|
-
productId: z.never().optional()
|
|
300
|
-
}),
|
|
301
|
-
z.object({
|
|
302
|
-
externalId: z.never().optional(),
|
|
303
|
-
productId: z.never().optional(),
|
|
304
|
-
inventoryId: z.string().describe("Inventory item ID.")
|
|
305
|
-
}),
|
|
306
|
-
z.object({
|
|
307
|
-
inventoryId: z.never().optional(),
|
|
308
|
-
productId: z.never().optional(),
|
|
309
|
-
externalId: z.string().describe("Deprecated (use productID instead).")
|
|
310
|
-
}),
|
|
311
|
-
z.object({
|
|
312
|
-
inventoryId: z.never().optional(),
|
|
313
|
-
externalId: z.never().optional(),
|
|
314
|
-
productId: z.string().describe("Product ID.")
|
|
315
|
-
})
|
|
316
|
-
])
|
|
317
|
-
).optional()
|
|
318
|
-
});
|
|
319
|
-
var GetInventoryVariantsResponse = z.object({
|
|
320
|
-
inventoryItem: z.object({
|
|
321
|
-
_id: z.string().describe("Inventory item ID.").optional().nullable(),
|
|
322
|
-
externalId: z.string().describe("Deprecated: use productId.").optional().nullable(),
|
|
323
|
-
productId: z.string().describe("Product ID.").optional().nullable(),
|
|
324
|
-
trackQuantity: z.boolean().describe("Whether quantity is being tracked.").optional().nullable(),
|
|
325
|
-
variants: z.array(
|
|
326
|
-
z.object({
|
|
327
|
-
variantId: z.string().describe("Variant ID.").optional(),
|
|
328
|
-
inStock: z.boolean().describe("Whether the product is listed as in stock.").optional().nullable(),
|
|
329
|
-
quantity: z.number().int().describe("Quantity currently left in inventory.").min(0).optional().nullable(),
|
|
330
|
-
availableForPreorder: z.boolean().describe(
|
|
331
|
-
"Whether the variant is available for preorder. When `true`, the variant is out of stock and preorder is enabled on inventory level."
|
|
332
|
-
).optional()
|
|
333
|
-
})
|
|
334
|
-
).optional(),
|
|
335
|
-
lastUpdated: z.date().describe("Last updated timestamp.").optional().nullable(),
|
|
336
|
-
numericId: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
337
|
-
"Inventory\u2019s unique numeric ID (assigned in ascending order).\nPrimarily for sorting and filtering when crawling all inventories."
|
|
338
|
-
).optional(),
|
|
339
|
-
preorderInfo: z.object({
|
|
340
|
-
enabled: z.boolean().describe("Whether the item is available for preorder.").optional(),
|
|
341
|
-
message: z.string().describe(
|
|
342
|
-
"A message the buyer will see when the item is out of stock and preorder is enabled."
|
|
343
|
-
).min(1).max(250).optional().nullable(),
|
|
344
|
-
limit: z.number().int().describe(
|
|
345
|
-
"Number of products that can be preordered after stock reaches zero."
|
|
346
|
-
).min(0).max(1e5).optional().nullable()
|
|
347
|
-
}).describe("Preorder information.").optional()
|
|
348
|
-
}).describe("Inventory item.").optional()
|
|
349
|
-
});
|
|
350
|
-
var QueryInventoryRequest = z.object({
|
|
351
|
-
options: z.object({
|
|
352
|
-
query: z.object({
|
|
353
|
-
paging: z.object({
|
|
354
|
-
limit: z.number().int().describe("Amount of items to load per page").min(0).max(100).optional().nullable(),
|
|
355
|
-
offset: z.number().int().describe(
|
|
356
|
-
"Number of items to skip in the display (relevant for all pages after the first)"
|
|
357
|
-
).min(0).optional().nullable()
|
|
358
|
-
}).optional(),
|
|
359
|
-
filter: z.string().describe("Filter string").optional().nullable(),
|
|
360
|
-
sort: z.string().describe("Sort string").optional().nullable()
|
|
361
|
-
}).optional()
|
|
362
|
-
}).optional()
|
|
363
|
-
});
|
|
364
|
-
var QueryInventoryResponse = z.object({
|
|
365
|
-
inventoryItems: z.array(
|
|
366
|
-
z.object({
|
|
367
|
-
_id: z.string().describe("Inventory item ID.").optional().nullable(),
|
|
368
|
-
externalId: z.string().describe("Deprecated: use productId.").optional().nullable(),
|
|
369
|
-
productId: z.string().describe("Product ID.").optional().nullable(),
|
|
370
|
-
trackQuantity: z.boolean().describe("Whether quantity is being tracked.").optional().nullable(),
|
|
371
|
-
variants: z.array(
|
|
372
|
-
z.object({
|
|
373
|
-
variantId: z.string().describe("Variant ID.").optional(),
|
|
374
|
-
inStock: z.boolean().describe("Whether the product is listed as in stock.").optional().nullable(),
|
|
375
|
-
quantity: z.number().int().describe("Quantity currently left in inventory.").min(0).optional().nullable(),
|
|
376
|
-
availableForPreorder: z.boolean().describe(
|
|
377
|
-
"Whether the variant is available for preorder. When `true`, the variant is out of stock and preorder is enabled on inventory level."
|
|
378
|
-
).optional()
|
|
379
|
-
})
|
|
380
|
-
).optional(),
|
|
381
|
-
lastUpdated: z.date().describe("Last updated timestamp.").optional().nullable(),
|
|
382
|
-
numericId: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
383
|
-
"Inventory\u2019s unique numeric ID (assigned in ascending order).\nPrimarily for sorting and filtering when crawling all inventories."
|
|
384
|
-
).optional(),
|
|
385
|
-
preorderInfo: z.object({
|
|
386
|
-
enabled: z.boolean().describe("Whether the item is available for preorder.").optional(),
|
|
387
|
-
message: z.string().describe(
|
|
388
|
-
"A message the buyer will see when the item is out of stock and preorder is enabled."
|
|
389
|
-
).min(1).max(250).optional().nullable(),
|
|
390
|
-
limit: z.number().int().describe(
|
|
391
|
-
"Number of products that can be preordered after stock reaches zero."
|
|
392
|
-
).min(0).max(1e5).optional().nullable()
|
|
393
|
-
}).describe("Preorder information.").optional()
|
|
394
|
-
})
|
|
395
|
-
).optional(),
|
|
396
|
-
metadata: z.object({
|
|
397
|
-
items: z.number().int().describe("Amount of items to load per page").optional(),
|
|
398
|
-
offset: z.number().int().describe(
|
|
399
|
-
"Number of items to skip in the display (relevant for all pages after the first)"
|
|
400
|
-
).optional()
|
|
401
|
-
}).describe("Display metadata.").optional(),
|
|
402
|
-
totalResults: z.number().int().describe("Number of total results.").optional()
|
|
403
|
-
});
|
|
404
|
-
var UpdateInventoryVariantsRequest = z.object({
|
|
405
|
-
productId: z.string().describe("Product ID."),
|
|
406
|
-
inventoryItem: z.object({
|
|
407
|
-
_id: z.string().describe("Inventory item ID.").optional().nullable(),
|
|
408
|
-
externalId: z.string().describe("Deprecated: use productId.").optional().nullable(),
|
|
409
|
-
productId: z.string().describe("Product ID.").optional().nullable(),
|
|
410
|
-
trackQuantity: z.boolean().describe("Whether quantity is being tracked.").optional().nullable(),
|
|
411
|
-
variants: z.array(
|
|
412
|
-
z.object({
|
|
413
|
-
variantId: z.string().describe("Variant ID.").optional(),
|
|
414
|
-
inStock: z.boolean().describe("Whether the product is listed as in stock.").optional().nullable(),
|
|
415
|
-
quantity: z.number().int().describe("Quantity currently left in inventory.").min(0).optional().nullable(),
|
|
416
|
-
availableForPreorder: z.boolean().describe(
|
|
417
|
-
"Whether the variant is available for preorder. When `true`, the variant is out of stock and preorder is enabled on inventory level."
|
|
418
|
-
).optional()
|
|
419
|
-
})
|
|
420
|
-
).optional(),
|
|
421
|
-
lastUpdated: z.date().describe("Last updated timestamp.").optional().nullable(),
|
|
422
|
-
numericId: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
423
|
-
"Inventory\u2019s unique numeric ID (assigned in ascending order).\nPrimarily for sorting and filtering when crawling all inventories."
|
|
424
|
-
).optional(),
|
|
425
|
-
preorderInfo: z.object({
|
|
426
|
-
enabled: z.boolean().describe("Whether the item is available for preorder.").optional(),
|
|
427
|
-
message: z.string().describe(
|
|
428
|
-
"A message the buyer will see when the item is out of stock and preorder is enabled."
|
|
429
|
-
).min(1).max(250).optional().nullable(),
|
|
430
|
-
limit: z.number().int().describe(
|
|
431
|
-
"Number of products that can be preordered after stock reaches zero."
|
|
432
|
-
).min(0).max(1e5).optional().nullable()
|
|
433
|
-
}).describe("Preorder information.").optional()
|
|
434
|
-
}).describe("Inventory item to update.")
|
|
435
|
-
});
|
|
436
|
-
var UpdateInventoryVariantsResponse = z.object({});
|
|
437
|
-
var DecrementInventoryRequest = z.object({
|
|
438
|
-
decrementData: z.array(
|
|
439
|
-
z.intersection(
|
|
440
|
-
z.object({
|
|
441
|
-
variantId: z.string().describe("Variant ID.").regex(
|
|
442
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
443
|
-
"Must be a valid GUID"
|
|
444
|
-
).optional(),
|
|
445
|
-
decrementBy: z.number().int().describe("Number to decrement inventory by.").min(1).optional(),
|
|
446
|
-
preorderRequest: z.boolean().describe(
|
|
447
|
-
"Whether the request to decrement the item's inventory was made as part of a purchase that includes preorder items.\nIf true and the item is available for preorder, we allow negative inventory.\nIf false and the item is not available for preorder, we allow regular buy flow (no negative inventory)."
|
|
448
|
-
).optional()
|
|
449
|
-
}),
|
|
450
|
-
z.xor([
|
|
451
|
-
z.object({
|
|
452
|
-
inventoryId: z.never().optional(),
|
|
453
|
-
externalId: z.never().optional(),
|
|
454
|
-
productId: z.never().optional()
|
|
455
|
-
}),
|
|
456
|
-
z.object({
|
|
457
|
-
externalId: z.never().optional(),
|
|
458
|
-
productId: z.never().optional(),
|
|
459
|
-
inventoryId: z.string().describe("Inventory item ID.").max(36)
|
|
460
|
-
}),
|
|
461
|
-
z.object({
|
|
462
|
-
inventoryId: z.never().optional(),
|
|
463
|
-
productId: z.never().optional(),
|
|
464
|
-
externalId: z.string().describe("Deprecated: use productId.").max(36)
|
|
465
|
-
}),
|
|
466
|
-
z.object({
|
|
467
|
-
inventoryId: z.never().optional(),
|
|
468
|
-
externalId: z.never().optional(),
|
|
469
|
-
productId: z.string().describe("Product ID.").max(36)
|
|
470
|
-
})
|
|
471
|
-
])
|
|
472
|
-
)
|
|
473
|
-
).min(1).max(300)
|
|
474
|
-
});
|
|
475
|
-
var DecrementInventoryResponse = z.object({});
|
|
476
|
-
var IncrementInventoryRequest = z.object({
|
|
477
|
-
incrementData: z.array(
|
|
478
|
-
z.intersection(
|
|
479
|
-
z.object({
|
|
480
|
-
variantId: z.string().describe("Variant ID.").regex(
|
|
481
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
482
|
-
"Must be a valid GUID"
|
|
483
|
-
).optional(),
|
|
484
|
-
incrementBy: z.number().int().describe("Number to increment inventory by.").min(1).optional()
|
|
485
|
-
}),
|
|
486
|
-
z.xor([
|
|
487
|
-
z.object({
|
|
488
|
-
inventoryId: z.never().optional(),
|
|
489
|
-
productId: z.never().optional()
|
|
490
|
-
}),
|
|
491
|
-
z.object({
|
|
492
|
-
productId: z.never().optional(),
|
|
493
|
-
inventoryId: z.string().describe("Inventory item ID.").max(36)
|
|
494
|
-
}),
|
|
495
|
-
z.object({
|
|
496
|
-
inventoryId: z.never().optional(),
|
|
497
|
-
productId: z.string().describe("Product ID.").max(36)
|
|
498
|
-
})
|
|
499
|
-
])
|
|
500
|
-
)
|
|
501
|
-
).min(1).max(300)
|
|
502
|
-
});
|
|
503
|
-
var IncrementInventoryResponse = z.object({});
|
|
504
|
-
|
|
505
289
|
// src/stores-v2-inventory-inventory.universal.ts
|
|
506
290
|
var ReasonType = /* @__PURE__ */ ((ReasonType2) => {
|
|
507
291
|
ReasonType2["UNKNOWN"] = "UNKNOWN";
|
|
@@ -519,10 +303,7 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
519
303
|
return WebhookIdentityType2;
|
|
520
304
|
})(WebhookIdentityType || {});
|
|
521
305
|
async function getInventoryVariants2(inventoryId, options) {
|
|
522
|
-
const { httpClient, sideEffects
|
|
523
|
-
if (validateRequestSchema) {
|
|
524
|
-
GetInventoryVariantsRequest.parse({ inventoryId, options });
|
|
525
|
-
}
|
|
306
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
526
307
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
527
308
|
inventoryId,
|
|
528
309
|
externalId: options?.externalId,
|
|
@@ -555,10 +336,7 @@ async function getInventoryVariants2(inventoryId, options) {
|
|
|
555
336
|
}
|
|
556
337
|
}
|
|
557
338
|
async function queryInventory2(options) {
|
|
558
|
-
const { httpClient, sideEffects
|
|
559
|
-
if (validateRequestSchema) {
|
|
560
|
-
QueryInventoryRequest.parse({ options });
|
|
561
|
-
}
|
|
339
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
562
340
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
563
341
|
query: options?.query
|
|
564
342
|
});
|
|
@@ -583,10 +361,7 @@ async function queryInventory2(options) {
|
|
|
583
361
|
}
|
|
584
362
|
}
|
|
585
363
|
async function updateInventoryVariants2(productId, inventoryItem) {
|
|
586
|
-
const { httpClient, sideEffects
|
|
587
|
-
if (validateRequestSchema) {
|
|
588
|
-
UpdateInventoryVariantsRequest.parse({ productId, inventoryItem });
|
|
589
|
-
}
|
|
364
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
590
365
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
591
366
|
inventoryItem: { ...inventoryItem, productId }
|
|
592
367
|
});
|
|
@@ -610,10 +385,7 @@ async function updateInventoryVariants2(productId, inventoryItem) {
|
|
|
610
385
|
}
|
|
611
386
|
}
|
|
612
387
|
async function decrementInventory2(decrementData) {
|
|
613
|
-
const { httpClient, sideEffects
|
|
614
|
-
if (validateRequestSchema) {
|
|
615
|
-
DecrementInventoryRequest.parse({ decrementData });
|
|
616
|
-
}
|
|
388
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
617
389
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
618
390
|
decrementData
|
|
619
391
|
});
|
|
@@ -637,10 +409,7 @@ async function decrementInventory2(decrementData) {
|
|
|
637
409
|
}
|
|
638
410
|
}
|
|
639
411
|
async function incrementInventory2(incrementData) {
|
|
640
|
-
const { httpClient, sideEffects
|
|
641
|
-
if (validateRequestSchema) {
|
|
642
|
-
IncrementInventoryRequest.parse({ incrementData });
|
|
643
|
-
}
|
|
412
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
644
413
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
645
414
|
incrementData
|
|
646
415
|
});
|
|
@@ -665,41 +434,41 @@ async function incrementInventory2(incrementData) {
|
|
|
665
434
|
}
|
|
666
435
|
|
|
667
436
|
// src/stores-v2-inventory-inventory.public.ts
|
|
668
|
-
function getInventoryVariants3(httpClient
|
|
437
|
+
function getInventoryVariants3(httpClient) {
|
|
669
438
|
return (inventoryId, options) => getInventoryVariants2(
|
|
670
439
|
inventoryId,
|
|
671
440
|
options,
|
|
672
441
|
// @ts-ignore
|
|
673
|
-
{ httpClient
|
|
442
|
+
{ httpClient }
|
|
674
443
|
);
|
|
675
444
|
}
|
|
676
|
-
function queryInventory3(httpClient
|
|
445
|
+
function queryInventory3(httpClient) {
|
|
677
446
|
return (options) => queryInventory2(
|
|
678
447
|
options,
|
|
679
448
|
// @ts-ignore
|
|
680
|
-
{ httpClient
|
|
449
|
+
{ httpClient }
|
|
681
450
|
);
|
|
682
451
|
}
|
|
683
|
-
function updateInventoryVariants3(httpClient
|
|
452
|
+
function updateInventoryVariants3(httpClient) {
|
|
684
453
|
return (productId, inventoryItem) => updateInventoryVariants2(
|
|
685
454
|
productId,
|
|
686
455
|
inventoryItem,
|
|
687
456
|
// @ts-ignore
|
|
688
|
-
{ httpClient
|
|
457
|
+
{ httpClient }
|
|
689
458
|
);
|
|
690
459
|
}
|
|
691
|
-
function decrementInventory3(httpClient
|
|
460
|
+
function decrementInventory3(httpClient) {
|
|
692
461
|
return (decrementData) => decrementInventory2(
|
|
693
462
|
decrementData,
|
|
694
463
|
// @ts-ignore
|
|
695
|
-
{ httpClient
|
|
464
|
+
{ httpClient }
|
|
696
465
|
);
|
|
697
466
|
}
|
|
698
|
-
function incrementInventory3(httpClient
|
|
467
|
+
function incrementInventory3(httpClient) {
|
|
699
468
|
return (incrementData) => incrementInventory2(
|
|
700
469
|
incrementData,
|
|
701
470
|
// @ts-ignore
|
|
702
|
-
{ httpClient
|
|
471
|
+
{ httpClient }
|
|
703
472
|
);
|
|
704
473
|
}
|
|
705
474
|
var onInventoryItemChanged = EventDefinition(
|