@wix/auto_sdk_stores_inventory 1.0.10 → 1.0.12

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.
Files changed (134) hide show
  1. package/build/index.d.mts +74 -0
  2. package/build/index.d.ts +74 -0
  3. package/build/index.js +541 -0
  4. package/build/index.js.map +1 -0
  5. package/build/index.mjs +509 -0
  6. package/build/index.mjs.map +1 -0
  7. package/build/internal/index.d.mts +74 -0
  8. package/build/internal/index.d.ts +74 -0
  9. package/build/internal/index.js +541 -0
  10. package/build/internal/index.js.map +1 -0
  11. package/build/internal/index.mjs +509 -0
  12. package/build/internal/index.mjs.map +1 -0
  13. package/build/internal/meta.d.mts +268 -0
  14. package/build/internal/meta.d.ts +268 -0
  15. package/build/internal/meta.js +391 -0
  16. package/build/internal/meta.js.map +1 -0
  17. package/build/internal/meta.mjs +360 -0
  18. package/build/internal/meta.mjs.map +1 -0
  19. package/build/internal/{cjs/src/stores-v2-inventory-inventory.types.d.ts → stores-v2-inventory-inventory.universal-CAYc4_b7.d.mts} +146 -51
  20. package/build/internal/{es/src/stores-v2-inventory-inventory.types.d.ts → stores-v2-inventory-inventory.universal-CAYc4_b7.d.ts} +146 -51
  21. package/build/meta.d.mts +268 -0
  22. package/build/meta.d.ts +268 -0
  23. package/build/meta.js +391 -0
  24. package/build/meta.js.map +1 -0
  25. package/build/meta.mjs +360 -0
  26. package/build/meta.mjs.map +1 -0
  27. package/build/{es/src/stores-v2-inventory-inventory.types.d.ts → stores-v2-inventory-inventory.universal-BltJPMge.d.mts} +108 -96
  28. package/build/{cjs/src/stores-v2-inventory-inventory.types.d.ts → stores-v2-inventory-inventory.universal-BltJPMge.d.ts} +108 -96
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/stores-v2-inventory-inventory.context.d.ts +0 -20
  40. package/build/cjs/src/stores-v2-inventory-inventory.context.js +0 -25
  41. package/build/cjs/src/stores-v2-inventory-inventory.context.js.map +0 -1
  42. package/build/cjs/src/stores-v2-inventory-inventory.http.d.ts +0 -31
  43. package/build/cjs/src/stores-v2-inventory-inventory.http.js +0 -291
  44. package/build/cjs/src/stores-v2-inventory-inventory.http.js.map +0 -1
  45. package/build/cjs/src/stores-v2-inventory-inventory.meta.d.ts +0 -21
  46. package/build/cjs/src/stores-v2-inventory-inventory.meta.js +0 -125
  47. package/build/cjs/src/stores-v2-inventory-inventory.meta.js.map +0 -1
  48. package/build/cjs/src/stores-v2-inventory-inventory.public.d.ts +0 -60
  49. package/build/cjs/src/stores-v2-inventory-inventory.public.js +0 -60
  50. package/build/cjs/src/stores-v2-inventory-inventory.public.js.map +0 -1
  51. package/build/cjs/src/stores-v2-inventory-inventory.types.js +0 -23
  52. package/build/cjs/src/stores-v2-inventory-inventory.types.js.map +0 -1
  53. package/build/cjs/src/stores-v2-inventory-inventory.universal.d.ts +0 -600
  54. package/build/cjs/src/stores-v2-inventory-inventory.universal.js +0 -277
  55. package/build/cjs/src/stores-v2-inventory-inventory.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/stores-v2-inventory-inventory.context.d.ts +0 -20
  67. package/build/es/src/stores-v2-inventory-inventory.context.js +0 -20
  68. package/build/es/src/stores-v2-inventory-inventory.context.js.map +0 -1
  69. package/build/es/src/stores-v2-inventory-inventory.http.d.ts +0 -31
  70. package/build/es/src/stores-v2-inventory-inventory.http.js +0 -283
  71. package/build/es/src/stores-v2-inventory-inventory.http.js.map +0 -1
  72. package/build/es/src/stores-v2-inventory-inventory.meta.d.ts +0 -21
  73. package/build/es/src/stores-v2-inventory-inventory.meta.js +0 -94
  74. package/build/es/src/stores-v2-inventory-inventory.meta.js.map +0 -1
  75. package/build/es/src/stores-v2-inventory-inventory.public.d.ts +0 -60
  76. package/build/es/src/stores-v2-inventory-inventory.public.js +0 -50
  77. package/build/es/src/stores-v2-inventory-inventory.public.js.map +0 -1
  78. package/build/es/src/stores-v2-inventory-inventory.types.js +0 -20
  79. package/build/es/src/stores-v2-inventory-inventory.types.js.map +0 -1
  80. package/build/es/src/stores-v2-inventory-inventory.universal.d.ts +0 -600
  81. package/build/es/src/stores-v2-inventory-inventory.universal.js +0 -246
  82. package/build/es/src/stores-v2-inventory-inventory.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/stores-v2-inventory-inventory.context.d.ts +0 -20
  93. package/build/internal/cjs/src/stores-v2-inventory-inventory.context.js +0 -25
  94. package/build/internal/cjs/src/stores-v2-inventory-inventory.context.js.map +0 -1
  95. package/build/internal/cjs/src/stores-v2-inventory-inventory.http.d.ts +0 -31
  96. package/build/internal/cjs/src/stores-v2-inventory-inventory.http.js +0 -291
  97. package/build/internal/cjs/src/stores-v2-inventory-inventory.http.js.map +0 -1
  98. package/build/internal/cjs/src/stores-v2-inventory-inventory.meta.d.ts +0 -21
  99. package/build/internal/cjs/src/stores-v2-inventory-inventory.meta.js +0 -125
  100. package/build/internal/cjs/src/stores-v2-inventory-inventory.meta.js.map +0 -1
  101. package/build/internal/cjs/src/stores-v2-inventory-inventory.public.d.ts +0 -60
  102. package/build/internal/cjs/src/stores-v2-inventory-inventory.public.js +0 -60
  103. package/build/internal/cjs/src/stores-v2-inventory-inventory.public.js.map +0 -1
  104. package/build/internal/cjs/src/stores-v2-inventory-inventory.types.js +0 -23
  105. package/build/internal/cjs/src/stores-v2-inventory-inventory.types.js.map +0 -1
  106. package/build/internal/cjs/src/stores-v2-inventory-inventory.universal.d.ts +0 -683
  107. package/build/internal/cjs/src/stores-v2-inventory-inventory.universal.js +0 -277
  108. package/build/internal/cjs/src/stores-v2-inventory-inventory.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/stores-v2-inventory-inventory.context.d.ts +0 -20
  119. package/build/internal/es/src/stores-v2-inventory-inventory.context.js +0 -20
  120. package/build/internal/es/src/stores-v2-inventory-inventory.context.js.map +0 -1
  121. package/build/internal/es/src/stores-v2-inventory-inventory.http.d.ts +0 -31
  122. package/build/internal/es/src/stores-v2-inventory-inventory.http.js +0 -283
  123. package/build/internal/es/src/stores-v2-inventory-inventory.http.js.map +0 -1
  124. package/build/internal/es/src/stores-v2-inventory-inventory.meta.d.ts +0 -21
  125. package/build/internal/es/src/stores-v2-inventory-inventory.meta.js +0 -94
  126. package/build/internal/es/src/stores-v2-inventory-inventory.meta.js.map +0 -1
  127. package/build/internal/es/src/stores-v2-inventory-inventory.public.d.ts +0 -60
  128. package/build/internal/es/src/stores-v2-inventory-inventory.public.js +0 -50
  129. package/build/internal/es/src/stores-v2-inventory-inventory.public.js.map +0 -1
  130. package/build/internal/es/src/stores-v2-inventory-inventory.types.js +0 -20
  131. package/build/internal/es/src/stores-v2-inventory-inventory.types.js.map +0 -1
  132. package/build/internal/es/src/stores-v2-inventory-inventory.universal.d.ts +0 -683
  133. package/build/internal/es/src/stores-v2-inventory-inventory.universal.js +0 -246
  134. package/build/internal/es/src/stores-v2-inventory-inventory.universal.js.map +0 -1
@@ -0,0 +1,74 @@
1
+ import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { U as UpdateInventoryVariantsInventoryItem, D as DecrementData, I as IncrementData, G as GetInventoryVariantsOptions, a as GetInventoryVariantsResponse, Q as QueryInventoryOptions, b as QueryInventoryResponse, c as InventoryItemChangedEnvelope, d as InventoryVariantsChangedEnvelope } from './stores-v2-inventory-inventory.universal-BltJPMge.mjs';
3
+ export { K as BaseEventMetadata, k as BulkUpdateInventoryItemsRequest, l as BulkUpdateInventoryItemsResponse, B as BulkUpdateInventoryVariantsRequest, i as BulkUpdateInventoryVariantsRequestActionOneOf, j as BulkUpdateInventoryVariantsResponse, C as ChangedInventoryVariant, u as ChangedInventoryVariantData, n as DecrementDataIdOneOf, m as DecrementInventoryRequest, o as DecrementInventoryResponse, x as GetInventoryItemsRequest, y as GetInventoryItemsResponse, L as GetInventoryVariantsOptionsIdOneOf, v as GetInventoryVariantsRequest, w as GetInventoryVariantsRequestIdOneOf, H as IdentificationData, J as IdentificationDataIdOneOf, q as IncrementDataIdOneOf, p as IncrementInventoryRequest, r as IncrementInventoryResponse, s as InventoryItemChanged, e as InventoryItemV2, f as InventoryVariantV2, t as InventoryVariantsChanged, M as MessageEnvelope, E as Paging, F as PagingMetadata, P as PreorderInfo, A as Query, z as QueryInventoryRequest, R as ReasonType, g as UpdateInventoryVariantsRequest, h as UpdateInventoryVariantsResponse, W as WebhookIdentityType } from './stores-v2-inventory-inventory.universal-BltJPMge.mjs';
4
+
5
+ declare function updateInventoryVariants$1(httpClient: HttpClient): UpdateInventoryVariantsSignature;
6
+ interface UpdateInventoryVariantsSignature {
7
+ /**
8
+ * Updates product inventory, including total quantity, whether the product is in stock, and whether the product inventory is tracked.
9
+ *
10
+ *
11
+ * The `updateInventoryVariants()` function is a Promise that resolves to the updated inventory variant data.
12
+ * @param - Product ID.
13
+ * @param - Inventory item to update.
14
+ */
15
+ (productId: string, inventoryItem: UpdateInventoryVariantsInventoryItem): Promise<void>;
16
+ }
17
+ declare function decrementInventory$1(httpClient: HttpClient): DecrementInventorySignature;
18
+ interface DecrementInventorySignature {
19
+ /**
20
+ * Subtracts a set number of items from inventory.
21
+ *
22
+ *
23
+ * The `decrementInventory()` function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory.
24
+ * @param - Item or product to decrement.
25
+ */
26
+ (decrementData: DecrementData[]): Promise<void>;
27
+ }
28
+ declare function incrementInventory$1(httpClient: HttpClient): IncrementInventorySignature;
29
+ interface IncrementInventorySignature {
30
+ /**
31
+ * Adds a set number of items to inventory.
32
+ *
33
+ *
34
+ * The `incrementInventory()` function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory.
35
+ * @param - Item or product to increment.
36
+ */
37
+ (incrementData: IncrementData[]): Promise<void>;
38
+ }
39
+ declare function getInventoryVariants$1(httpClient: HttpClient): GetInventoryVariantsSignature;
40
+ interface GetInventoryVariantsSignature {
41
+ /**
42
+ * Gets inventory variant information based on the specified option choices.
43
+ *
44
+ *
45
+ * The `getInventoryVariants()` function returns a Promise that resolves to the specified inventory variant information.
46
+ * @param - Inventory item ID.
47
+ */
48
+ (inventoryId: string, options?: GetInventoryVariantsOptions | undefined): Promise<GetInventoryVariantsResponse>;
49
+ }
50
+ declare function queryInventory$1(httpClient: HttpClient): QueryInventorySignature;
51
+ interface QueryInventorySignature {
52
+ /**
53
+ * Returns a list of inventory items, given the provided paging, sorting and filtering.
54
+ */
55
+ (options?: QueryInventoryOptions | undefined): Promise<QueryInventoryResponse>;
56
+ }
57
+ declare const onInventoryItemChanged$1: EventDefinition<InventoryItemChangedEnvelope, "com.wix.ecommerce.inventory.api.v1.InventoryItemChanged">;
58
+ declare const onInventoryVariantsChanged$1: EventDefinition<InventoryVariantsChangedEnvelope, "com.wix.ecommerce.inventory.api.v1.InventoryVariantsChanged">;
59
+
60
+ declare const updateInventoryVariants: MaybeContext<BuildRESTFunction<typeof updateInventoryVariants$1> & typeof updateInventoryVariants$1>;
61
+ declare const decrementInventory: MaybeContext<BuildRESTFunction<typeof decrementInventory$1> & typeof decrementInventory$1>;
62
+ declare const incrementInventory: MaybeContext<BuildRESTFunction<typeof incrementInventory$1> & typeof incrementInventory$1>;
63
+ declare const getInventoryVariants: MaybeContext<BuildRESTFunction<typeof getInventoryVariants$1> & typeof getInventoryVariants$1>;
64
+ declare const queryInventory: MaybeContext<BuildRESTFunction<typeof queryInventory$1> & typeof queryInventory$1>;
65
+ /**
66
+ * Triggered when an inventory item is changed.
67
+ */
68
+ declare const onInventoryItemChanged: BuildEventDefinition<typeof onInventoryItemChanged$1>;
69
+ /**
70
+ * Triggered when inventory variants are changed.
71
+ */
72
+ declare const onInventoryVariantsChanged: BuildEventDefinition<typeof onInventoryVariantsChanged$1>;
73
+
74
+ export { DecrementData, GetInventoryVariantsOptions, GetInventoryVariantsResponse, IncrementData, InventoryItemChangedEnvelope, InventoryVariantsChangedEnvelope, QueryInventoryOptions, QueryInventoryResponse, UpdateInventoryVariantsInventoryItem, decrementInventory, getInventoryVariants, incrementInventory, onInventoryItemChanged, onInventoryVariantsChanged, queryInventory, updateInventoryVariants };
@@ -0,0 +1,74 @@
1
+ import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { U as UpdateInventoryVariantsInventoryItem, D as DecrementData, I as IncrementData, G as GetInventoryVariantsOptions, a as GetInventoryVariantsResponse, Q as QueryInventoryOptions, b as QueryInventoryResponse, c as InventoryItemChangedEnvelope, d as InventoryVariantsChangedEnvelope } from './stores-v2-inventory-inventory.universal-BltJPMge.js';
3
+ export { K as BaseEventMetadata, k as BulkUpdateInventoryItemsRequest, l as BulkUpdateInventoryItemsResponse, B as BulkUpdateInventoryVariantsRequest, i as BulkUpdateInventoryVariantsRequestActionOneOf, j as BulkUpdateInventoryVariantsResponse, C as ChangedInventoryVariant, u as ChangedInventoryVariantData, n as DecrementDataIdOneOf, m as DecrementInventoryRequest, o as DecrementInventoryResponse, x as GetInventoryItemsRequest, y as GetInventoryItemsResponse, L as GetInventoryVariantsOptionsIdOneOf, v as GetInventoryVariantsRequest, w as GetInventoryVariantsRequestIdOneOf, H as IdentificationData, J as IdentificationDataIdOneOf, q as IncrementDataIdOneOf, p as IncrementInventoryRequest, r as IncrementInventoryResponse, s as InventoryItemChanged, e as InventoryItemV2, f as InventoryVariantV2, t as InventoryVariantsChanged, M as MessageEnvelope, E as Paging, F as PagingMetadata, P as PreorderInfo, A as Query, z as QueryInventoryRequest, R as ReasonType, g as UpdateInventoryVariantsRequest, h as UpdateInventoryVariantsResponse, W as WebhookIdentityType } from './stores-v2-inventory-inventory.universal-BltJPMge.js';
4
+
5
+ declare function updateInventoryVariants$1(httpClient: HttpClient): UpdateInventoryVariantsSignature;
6
+ interface UpdateInventoryVariantsSignature {
7
+ /**
8
+ * Updates product inventory, including total quantity, whether the product is in stock, and whether the product inventory is tracked.
9
+ *
10
+ *
11
+ * The `updateInventoryVariants()` function is a Promise that resolves to the updated inventory variant data.
12
+ * @param - Product ID.
13
+ * @param - Inventory item to update.
14
+ */
15
+ (productId: string, inventoryItem: UpdateInventoryVariantsInventoryItem): Promise<void>;
16
+ }
17
+ declare function decrementInventory$1(httpClient: HttpClient): DecrementInventorySignature;
18
+ interface DecrementInventorySignature {
19
+ /**
20
+ * Subtracts a set number of items from inventory.
21
+ *
22
+ *
23
+ * The `decrementInventory()` function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory.
24
+ * @param - Item or product to decrement.
25
+ */
26
+ (decrementData: DecrementData[]): Promise<void>;
27
+ }
28
+ declare function incrementInventory$1(httpClient: HttpClient): IncrementInventorySignature;
29
+ interface IncrementInventorySignature {
30
+ /**
31
+ * Adds a set number of items to inventory.
32
+ *
33
+ *
34
+ * The `incrementInventory()` function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory.
35
+ * @param - Item or product to increment.
36
+ */
37
+ (incrementData: IncrementData[]): Promise<void>;
38
+ }
39
+ declare function getInventoryVariants$1(httpClient: HttpClient): GetInventoryVariantsSignature;
40
+ interface GetInventoryVariantsSignature {
41
+ /**
42
+ * Gets inventory variant information based on the specified option choices.
43
+ *
44
+ *
45
+ * The `getInventoryVariants()` function returns a Promise that resolves to the specified inventory variant information.
46
+ * @param - Inventory item ID.
47
+ */
48
+ (inventoryId: string, options?: GetInventoryVariantsOptions | undefined): Promise<GetInventoryVariantsResponse>;
49
+ }
50
+ declare function queryInventory$1(httpClient: HttpClient): QueryInventorySignature;
51
+ interface QueryInventorySignature {
52
+ /**
53
+ * Returns a list of inventory items, given the provided paging, sorting and filtering.
54
+ */
55
+ (options?: QueryInventoryOptions | undefined): Promise<QueryInventoryResponse>;
56
+ }
57
+ declare const onInventoryItemChanged$1: EventDefinition<InventoryItemChangedEnvelope, "com.wix.ecommerce.inventory.api.v1.InventoryItemChanged">;
58
+ declare const onInventoryVariantsChanged$1: EventDefinition<InventoryVariantsChangedEnvelope, "com.wix.ecommerce.inventory.api.v1.InventoryVariantsChanged">;
59
+
60
+ declare const updateInventoryVariants: MaybeContext<BuildRESTFunction<typeof updateInventoryVariants$1> & typeof updateInventoryVariants$1>;
61
+ declare const decrementInventory: MaybeContext<BuildRESTFunction<typeof decrementInventory$1> & typeof decrementInventory$1>;
62
+ declare const incrementInventory: MaybeContext<BuildRESTFunction<typeof incrementInventory$1> & typeof incrementInventory$1>;
63
+ declare const getInventoryVariants: MaybeContext<BuildRESTFunction<typeof getInventoryVariants$1> & typeof getInventoryVariants$1>;
64
+ declare const queryInventory: MaybeContext<BuildRESTFunction<typeof queryInventory$1> & typeof queryInventory$1>;
65
+ /**
66
+ * Triggered when an inventory item is changed.
67
+ */
68
+ declare const onInventoryItemChanged: BuildEventDefinition<typeof onInventoryItemChanged$1>;
69
+ /**
70
+ * Triggered when inventory variants are changed.
71
+ */
72
+ declare const onInventoryVariantsChanged: BuildEventDefinition<typeof onInventoryVariantsChanged$1>;
73
+
74
+ export { DecrementData, GetInventoryVariantsOptions, GetInventoryVariantsResponse, IncrementData, InventoryItemChangedEnvelope, InventoryVariantsChangedEnvelope, QueryInventoryOptions, QueryInventoryResponse, UpdateInventoryVariantsInventoryItem, decrementInventory, getInventoryVariants, incrementInventory, onInventoryItemChanged, onInventoryVariantsChanged, queryInventory, updateInventoryVariants };
package/build/index.js ADDED
@@ -0,0 +1,541 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ReasonType: () => ReasonType,
24
+ WebhookIdentityType: () => WebhookIdentityType,
25
+ decrementInventory: () => decrementInventory4,
26
+ getInventoryVariants: () => getInventoryVariants4,
27
+ incrementInventory: () => incrementInventory4,
28
+ onInventoryItemChanged: () => onInventoryItemChanged2,
29
+ onInventoryVariantsChanged: () => onInventoryVariantsChanged2,
30
+ queryInventory: () => queryInventory4,
31
+ updateInventoryVariants: () => updateInventoryVariants4
32
+ });
33
+ module.exports = __toCommonJS(index_exports);
34
+
35
+ // src/stores-v2-inventory-inventory.public.ts
36
+ var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
37
+ var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
38
+ var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
39
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
40
+ var import_sdk_types = require("@wix/sdk-types");
41
+
42
+ // src/stores-v2-inventory-inventory.universal.ts
43
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
44
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
45
+
46
+ // src/stores-v2-inventory-inventory.http.ts
47
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
48
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
49
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
50
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
51
+ function resolveWixInventoryApiV1InventoryReadApiUrl(opts) {
52
+ const domainToMappings = {
53
+ "api._api_base_domain_": [
54
+ {
55
+ srcPath: "/wix-ecommerce-catalog-reader-web",
56
+ destPath: ""
57
+ }
58
+ ],
59
+ "manage._base_domain_": [
60
+ {
61
+ srcPath: "/wix-ecommerce-catalog-reader-web",
62
+ destPath: ""
63
+ }
64
+ ],
65
+ "www.wixapis.com": [
66
+ {
67
+ srcPath: "/stores-reader/v2/collections",
68
+ destPath: "/v2/collections"
69
+ },
70
+ {
71
+ srcPath: "/stores-reader/v2/inventoryItems",
72
+ destPath: "/v2/inventoryItems"
73
+ }
74
+ ],
75
+ "www._base_domain_": [
76
+ {
77
+ srcPath: "/wix-ecommerce-catalog-reader-web",
78
+ destPath: ""
79
+ }
80
+ ],
81
+ "editor._base_domain_": [
82
+ {
83
+ srcPath: "/_api/wix-ecommerce-catalog-reader-web",
84
+ destPath: ""
85
+ }
86
+ ],
87
+ "blocks._base_domain_": [
88
+ {
89
+ srcPath: "/_api/wix-ecommerce-catalog-reader-web",
90
+ destPath: ""
91
+ }
92
+ ],
93
+ "create.editorx": [
94
+ {
95
+ srcPath: "/_api/wix-ecommerce-catalog-reader-web",
96
+ destPath: ""
97
+ }
98
+ ],
99
+ _: [
100
+ {
101
+ srcPath: "/stores-reader/v2/inventoryItems",
102
+ destPath: "/v2/inventoryItems"
103
+ },
104
+ {
105
+ srcPath: "/stores-reader/v2/collections",
106
+ destPath: "/v2/collections"
107
+ }
108
+ ]
109
+ };
110
+ return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
111
+ }
112
+ function resolveWixInventoryApiV1InventoryWriteApiUrl(opts) {
113
+ const domainToMappings = {
114
+ "api._api_base_domain_": [
115
+ {
116
+ srcPath: "/wix-ecommerce-catalog-web",
117
+ destPath: ""
118
+ }
119
+ ],
120
+ "www._base_domain_": [
121
+ {
122
+ srcPath: "/_api/catalog-server",
123
+ destPath: ""
124
+ },
125
+ {
126
+ srcPath: "/wix-ecommerce-catalog",
127
+ destPath: ""
128
+ }
129
+ ],
130
+ "ecom._base_domain_": [
131
+ {
132
+ srcPath: "/_api/catalog-server",
133
+ destPath: ""
134
+ }
135
+ ],
136
+ "*.pub.wix-code.com": [
137
+ {
138
+ srcPath: "/_api/catalog-server",
139
+ destPath: ""
140
+ }
141
+ ],
142
+ "www.wixapis.com": [
143
+ {
144
+ srcPath: "/stores/v1/inventoryItems",
145
+ destPath: "/v1/inventoryItems"
146
+ },
147
+ {
148
+ srcPath: "/stores/v2/inventoryItems",
149
+ destPath: "/v2/inventoryItems"
150
+ }
151
+ ],
152
+ "manage._base_domain_": [
153
+ {
154
+ srcPath: "/wix-ecommerce-catalog",
155
+ destPath: ""
156
+ }
157
+ ],
158
+ "editor.wixapps.net": [
159
+ {
160
+ srcPath: "/_api/catalog-server",
161
+ destPath: ""
162
+ }
163
+ ],
164
+ "www.wixgateway.com": [
165
+ {
166
+ srcPath: "/stores/v1/products",
167
+ destPath: "/v1/products"
168
+ },
169
+ {
170
+ srcPath: "/stores/v1/collections",
171
+ destPath: "/v1/collections"
172
+ }
173
+ ],
174
+ "editor._base_domain_": [
175
+ {
176
+ srcPath: "/_api/catalog-server",
177
+ destPath: ""
178
+ }
179
+ ],
180
+ "blocks._base_domain_": [
181
+ {
182
+ srcPath: "/_api/catalog-server",
183
+ destPath: ""
184
+ }
185
+ ],
186
+ "create.editorx": [
187
+ {
188
+ srcPath: "/_api/catalog-server",
189
+ destPath: ""
190
+ }
191
+ ]
192
+ };
193
+ return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
194
+ }
195
+ var PACKAGE_NAME = "@wix/auto_sdk_stores_inventory";
196
+ function updateInventoryVariants(payload) {
197
+ function __updateInventoryVariants({ host }) {
198
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
199
+ {
200
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
201
+ paths: [{ path: "inventoryItem.lastUpdated" }]
202
+ }
203
+ ]);
204
+ const metadata = {
205
+ entityFqdn: "wix.stores.v2.inventory",
206
+ method: "PATCH",
207
+ methodFqn: "wix.inventory.api.v1.InventoryWriteApi.UpdateInventoryVariants",
208
+ packageName: PACKAGE_NAME,
209
+ url: resolveWixInventoryApiV1InventoryWriteApiUrl({
210
+ protoPath: "/v2/inventoryItems/product/{inventoryItem.productId}",
211
+ data: serializedData,
212
+ host
213
+ }),
214
+ data: serializedData
215
+ };
216
+ return metadata;
217
+ }
218
+ return __updateInventoryVariants;
219
+ }
220
+ function decrementInventory(payload) {
221
+ function __decrementInventory({ host }) {
222
+ const metadata = {
223
+ entityFqdn: "wix.stores.v2.inventory",
224
+ method: "POST",
225
+ methodFqn: "wix.inventory.api.v1.InventoryWriteApi.DecrementInventory",
226
+ packageName: PACKAGE_NAME,
227
+ url: resolveWixInventoryApiV1InventoryWriteApiUrl({
228
+ protoPath: "/v2/inventoryItems/decrement",
229
+ data: payload,
230
+ host
231
+ }),
232
+ data: payload
233
+ };
234
+ return metadata;
235
+ }
236
+ return __decrementInventory;
237
+ }
238
+ function incrementInventory(payload) {
239
+ function __incrementInventory({ host }) {
240
+ const metadata = {
241
+ entityFqdn: "wix.stores.v2.inventory",
242
+ method: "POST",
243
+ methodFqn: "wix.inventory.api.v1.InventoryWriteApi.IncrementInventory",
244
+ packageName: PACKAGE_NAME,
245
+ url: resolveWixInventoryApiV1InventoryWriteApiUrl({
246
+ protoPath: "/v2/inventoryItems/increment",
247
+ data: payload,
248
+ host
249
+ }),
250
+ data: payload
251
+ };
252
+ return metadata;
253
+ }
254
+ return __incrementInventory;
255
+ }
256
+ function getInventoryVariants(payload) {
257
+ function __getInventoryVariants({ host }) {
258
+ const metadata = {
259
+ entityFqdn: "wix.stores.v2.inventory",
260
+ method: "POST",
261
+ methodFqn: "wix.inventory.api.v1.InventoryReadApi.GetInventoryVariants",
262
+ packageName: PACKAGE_NAME,
263
+ url: resolveWixInventoryApiV1InventoryReadApiUrl({
264
+ protoPath: "/v2/inventoryItems/{inventoryId}/getVariants",
265
+ data: payload,
266
+ host
267
+ }),
268
+ data: payload,
269
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
270
+ {
271
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
272
+ paths: [{ path: "inventoryItem.lastUpdated" }]
273
+ }
274
+ ])
275
+ };
276
+ return metadata;
277
+ }
278
+ return __getInventoryVariants;
279
+ }
280
+ function queryInventory(payload) {
281
+ function __queryInventory({ host }) {
282
+ const metadata = {
283
+ entityFqdn: "wix.stores.v2.inventory",
284
+ method: "POST",
285
+ methodFqn: "wix.inventory.api.v1.InventoryReadApi.QueryInventory",
286
+ packageName: PACKAGE_NAME,
287
+ url: resolveWixInventoryApiV1InventoryReadApiUrl({
288
+ protoPath: "/v2/inventoryItems/query",
289
+ data: payload,
290
+ host
291
+ }),
292
+ data: payload,
293
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
294
+ {
295
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
296
+ paths: [{ path: "inventoryItems.lastUpdated" }]
297
+ }
298
+ ])
299
+ };
300
+ return metadata;
301
+ }
302
+ return __queryInventory;
303
+ }
304
+
305
+ // src/stores-v2-inventory-inventory.universal.ts
306
+ var ReasonType = /* @__PURE__ */ ((ReasonType2) => {
307
+ ReasonType2["UNKNOWN"] = "UNKNOWN";
308
+ ReasonType2["ORDER"] = "ORDER";
309
+ ReasonType2["MANUAL"] = "MANUAL";
310
+ ReasonType2["REVERT_INVENTORY_CHANGE"] = "REVERT_INVENTORY_CHANGE";
311
+ return ReasonType2;
312
+ })(ReasonType || {});
313
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
314
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
315
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
316
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
317
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
318
+ WebhookIdentityType2["APP"] = "APP";
319
+ return WebhookIdentityType2;
320
+ })(WebhookIdentityType || {});
321
+ async function updateInventoryVariants2(productId, inventoryItem) {
322
+ const { httpClient, sideEffects } = arguments[2];
323
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
324
+ inventoryItem: { ...inventoryItem, productId }
325
+ });
326
+ const reqOpts = updateInventoryVariants(payload);
327
+ sideEffects?.onSiteCall?.();
328
+ try {
329
+ const result = await httpClient.request(reqOpts);
330
+ sideEffects?.onSuccess?.(result);
331
+ } catch (err) {
332
+ const transformedError = (0, import_transform_error.transformError)(
333
+ err,
334
+ {
335
+ spreadPathsToArguments: { inventoryItem: "$[1]" },
336
+ explicitPathsToArguments: { "inventoryItem.productId": "$[0]" },
337
+ singleArgumentUnchanged: false
338
+ },
339
+ ["productId", "inventoryItem"]
340
+ );
341
+ sideEffects?.onError?.(err);
342
+ throw transformedError;
343
+ }
344
+ }
345
+ async function decrementInventory2(decrementData) {
346
+ const { httpClient, sideEffects } = arguments[1];
347
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
348
+ decrementData
349
+ });
350
+ const reqOpts = decrementInventory(payload);
351
+ sideEffects?.onSiteCall?.();
352
+ try {
353
+ const result = await httpClient.request(reqOpts);
354
+ sideEffects?.onSuccess?.(result);
355
+ } catch (err) {
356
+ const transformedError = (0, import_transform_error.transformError)(
357
+ err,
358
+ {
359
+ spreadPathsToArguments: {},
360
+ explicitPathsToArguments: { decrementData: "$[0]" },
361
+ singleArgumentUnchanged: false
362
+ },
363
+ ["decrementData"]
364
+ );
365
+ sideEffects?.onError?.(err);
366
+ throw transformedError;
367
+ }
368
+ }
369
+ async function incrementInventory2(incrementData) {
370
+ const { httpClient, sideEffects } = arguments[1];
371
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
372
+ incrementData
373
+ });
374
+ const reqOpts = incrementInventory(payload);
375
+ sideEffects?.onSiteCall?.();
376
+ try {
377
+ const result = await httpClient.request(reqOpts);
378
+ sideEffects?.onSuccess?.(result);
379
+ } catch (err) {
380
+ const transformedError = (0, import_transform_error.transformError)(
381
+ err,
382
+ {
383
+ spreadPathsToArguments: {},
384
+ explicitPathsToArguments: { incrementData: "$[0]" },
385
+ singleArgumentUnchanged: false
386
+ },
387
+ ["incrementData"]
388
+ );
389
+ sideEffects?.onError?.(err);
390
+ throw transformedError;
391
+ }
392
+ }
393
+ async function getInventoryVariants2(inventoryId, options) {
394
+ const { httpClient, sideEffects } = arguments[2];
395
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
396
+ inventoryId,
397
+ externalId: options?.externalId,
398
+ productId: options?.productId,
399
+ variantIds: options?.variantIds
400
+ });
401
+ const reqOpts = getInventoryVariants(payload);
402
+ sideEffects?.onSiteCall?.();
403
+ try {
404
+ const result = await httpClient.request(reqOpts);
405
+ sideEffects?.onSuccess?.(result);
406
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
407
+ } catch (err) {
408
+ const transformedError = (0, import_transform_error.transformError)(
409
+ err,
410
+ {
411
+ spreadPathsToArguments: {},
412
+ explicitPathsToArguments: {
413
+ inventoryId: "$[0]",
414
+ externalId: "$[1].externalId",
415
+ productId: "$[1].productId",
416
+ variantIds: "$[1].variantIds"
417
+ },
418
+ singleArgumentUnchanged: false
419
+ },
420
+ ["inventoryId", "options"]
421
+ );
422
+ sideEffects?.onError?.(err);
423
+ throw transformedError;
424
+ }
425
+ }
426
+ async function queryInventory2(options) {
427
+ const { httpClient, sideEffects } = arguments[1];
428
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
429
+ query: options?.query
430
+ });
431
+ const reqOpts = queryInventory(payload);
432
+ sideEffects?.onSiteCall?.();
433
+ try {
434
+ const result = await httpClient.request(reqOpts);
435
+ sideEffects?.onSuccess?.(result);
436
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
437
+ } catch (err) {
438
+ const transformedError = (0, import_transform_error.transformError)(
439
+ err,
440
+ {
441
+ spreadPathsToArguments: {},
442
+ explicitPathsToArguments: { query: "$[0].query" },
443
+ singleArgumentUnchanged: false
444
+ },
445
+ ["options"]
446
+ );
447
+ sideEffects?.onError?.(err);
448
+ throw transformedError;
449
+ }
450
+ }
451
+
452
+ // src/stores-v2-inventory-inventory.public.ts
453
+ function updateInventoryVariants3(httpClient) {
454
+ return (productId, inventoryItem) => updateInventoryVariants2(
455
+ productId,
456
+ inventoryItem,
457
+ // @ts-ignore
458
+ { httpClient }
459
+ );
460
+ }
461
+ function decrementInventory3(httpClient) {
462
+ return (decrementData) => decrementInventory2(
463
+ decrementData,
464
+ // @ts-ignore
465
+ { httpClient }
466
+ );
467
+ }
468
+ function incrementInventory3(httpClient) {
469
+ return (incrementData) => incrementInventory2(
470
+ incrementData,
471
+ // @ts-ignore
472
+ { httpClient }
473
+ );
474
+ }
475
+ function getInventoryVariants3(httpClient) {
476
+ return (inventoryId, options) => getInventoryVariants2(
477
+ inventoryId,
478
+ options,
479
+ // @ts-ignore
480
+ { httpClient }
481
+ );
482
+ }
483
+ function queryInventory3(httpClient) {
484
+ return (options) => queryInventory2(
485
+ options,
486
+ // @ts-ignore
487
+ { httpClient }
488
+ );
489
+ }
490
+ var onInventoryItemChanged = (0, import_sdk_types.EventDefinition)(
491
+ "com.wix.ecommerce.inventory.api.v1.InventoryItemChanged",
492
+ false,
493
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
494
+ (0, import_transform_paths2.transformPaths)(event, [
495
+ {
496
+ transformFn: import_field_mask.transformRESTFieldMaskToSDKFieldMask,
497
+ paths: [{ path: "data.fieldMask" }]
498
+ },
499
+ {
500
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
501
+ paths: [{ path: "data.updatedDate" }]
502
+ }
503
+ ])
504
+ )
505
+ )();
506
+ var onInventoryVariantsChanged = (0, import_sdk_types.EventDefinition)(
507
+ "com.wix.ecommerce.inventory.api.v1.InventoryVariantsChanged",
508
+ false,
509
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
510
+ (0, import_transform_paths2.transformPaths)(event, [
511
+ {
512
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
513
+ paths: [{ path: "data.updatedDate" }]
514
+ }
515
+ ])
516
+ )
517
+ )();
518
+
519
+ // src/stores-v2-inventory-inventory.context.ts
520
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
521
+ var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
522
+ var updateInventoryVariants4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(updateInventoryVariants3);
523
+ var decrementInventory4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(decrementInventory3);
524
+ var incrementInventory4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(incrementInventory3);
525
+ var getInventoryVariants4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(getInventoryVariants3);
526
+ var queryInventory4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(queryInventory3);
527
+ var onInventoryItemChanged2 = (0, import_event_definition_modules.createEventModule)(onInventoryItemChanged);
528
+ var onInventoryVariantsChanged2 = (0, import_event_definition_modules.createEventModule)(onInventoryVariantsChanged);
529
+ // Annotate the CommonJS export names for ESM import in node:
530
+ 0 && (module.exports = {
531
+ ReasonType,
532
+ WebhookIdentityType,
533
+ decrementInventory,
534
+ getInventoryVariants,
535
+ incrementInventory,
536
+ onInventoryItemChanged,
537
+ onInventoryVariantsChanged,
538
+ queryInventory,
539
+ updateInventoryVariants
540
+ });
541
+ //# sourceMappingURL=index.js.map