@wix/auto_sdk_stores_inventory 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/stores-v2-inventory-inventory.context.d.ts +20 -0
  11. package/build/cjs/src/stores-v2-inventory-inventory.context.js +25 -0
  12. package/build/cjs/src/stores-v2-inventory-inventory.context.js.map +1 -0
  13. package/build/cjs/src/stores-v2-inventory-inventory.http.d.ts +31 -0
  14. package/build/cjs/src/stores-v2-inventory-inventory.http.js +291 -0
  15. package/build/cjs/src/stores-v2-inventory-inventory.http.js.map +1 -0
  16. package/build/cjs/src/stores-v2-inventory-inventory.meta.d.ts +21 -0
  17. package/build/cjs/src/stores-v2-inventory-inventory.meta.js +125 -0
  18. package/build/cjs/src/stores-v2-inventory-inventory.meta.js.map +1 -0
  19. package/build/cjs/src/stores-v2-inventory-inventory.public.d.ts +60 -0
  20. package/build/cjs/src/stores-v2-inventory-inventory.public.js +60 -0
  21. package/build/cjs/src/stores-v2-inventory-inventory.public.js.map +1 -0
  22. package/build/cjs/src/stores-v2-inventory-inventory.types.d.ts +358 -0
  23. package/build/cjs/src/stores-v2-inventory-inventory.types.js +23 -0
  24. package/build/cjs/src/stores-v2-inventory-inventory.types.js.map +1 -0
  25. package/build/cjs/src/stores-v2-inventory-inventory.universal.d.ts +489 -0
  26. package/build/cjs/src/stores-v2-inventory-inventory.universal.js +269 -0
  27. package/build/cjs/src/stores-v2-inventory-inventory.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/stores-v2-inventory-inventory.context.d.ts +20 -0
  39. package/build/es/src/stores-v2-inventory-inventory.context.js +20 -0
  40. package/build/es/src/stores-v2-inventory-inventory.context.js.map +1 -0
  41. package/build/es/src/stores-v2-inventory-inventory.http.d.ts +31 -0
  42. package/build/es/src/stores-v2-inventory-inventory.http.js +283 -0
  43. package/build/es/src/stores-v2-inventory-inventory.http.js.map +1 -0
  44. package/build/es/src/stores-v2-inventory-inventory.meta.d.ts +21 -0
  45. package/build/es/src/stores-v2-inventory-inventory.meta.js +94 -0
  46. package/build/es/src/stores-v2-inventory-inventory.meta.js.map +1 -0
  47. package/build/es/src/stores-v2-inventory-inventory.public.d.ts +60 -0
  48. package/build/es/src/stores-v2-inventory-inventory.public.js +50 -0
  49. package/build/es/src/stores-v2-inventory-inventory.public.js.map +1 -0
  50. package/build/es/src/stores-v2-inventory-inventory.types.d.ts +358 -0
  51. package/build/es/src/stores-v2-inventory-inventory.types.js +20 -0
  52. package/build/es/src/stores-v2-inventory-inventory.types.js.map +1 -0
  53. package/build/es/src/stores-v2-inventory-inventory.universal.d.ts +489 -0
  54. package/build/es/src/stores-v2-inventory-inventory.universal.js +238 -0
  55. package/build/es/src/stores-v2-inventory-inventory.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/stores-v2-inventory-inventory.context.d.ts +20 -0
  66. package/build/internal/cjs/src/stores-v2-inventory-inventory.context.js +25 -0
  67. package/build/internal/cjs/src/stores-v2-inventory-inventory.context.js.map +1 -0
  68. package/build/internal/cjs/src/stores-v2-inventory-inventory.http.d.ts +31 -0
  69. package/build/internal/cjs/src/stores-v2-inventory-inventory.http.js +291 -0
  70. package/build/internal/cjs/src/stores-v2-inventory-inventory.http.js.map +1 -0
  71. package/build/internal/cjs/src/stores-v2-inventory-inventory.meta.d.ts +21 -0
  72. package/build/internal/cjs/src/stores-v2-inventory-inventory.meta.js +125 -0
  73. package/build/internal/cjs/src/stores-v2-inventory-inventory.meta.js.map +1 -0
  74. package/build/internal/cjs/src/stores-v2-inventory-inventory.public.d.ts +60 -0
  75. package/build/internal/cjs/src/stores-v2-inventory-inventory.public.js +60 -0
  76. package/build/internal/cjs/src/stores-v2-inventory-inventory.public.js.map +1 -0
  77. package/build/internal/cjs/src/stores-v2-inventory-inventory.types.d.ts +358 -0
  78. package/build/internal/cjs/src/stores-v2-inventory-inventory.types.js +23 -0
  79. package/build/internal/cjs/src/stores-v2-inventory-inventory.types.js.map +1 -0
  80. package/build/internal/cjs/src/stores-v2-inventory-inventory.universal.d.ts +563 -0
  81. package/build/internal/cjs/src/stores-v2-inventory-inventory.universal.js +269 -0
  82. package/build/internal/cjs/src/stores-v2-inventory-inventory.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/stores-v2-inventory-inventory.context.d.ts +20 -0
  93. package/build/internal/es/src/stores-v2-inventory-inventory.context.js +20 -0
  94. package/build/internal/es/src/stores-v2-inventory-inventory.context.js.map +1 -0
  95. package/build/internal/es/src/stores-v2-inventory-inventory.http.d.ts +31 -0
  96. package/build/internal/es/src/stores-v2-inventory-inventory.http.js +283 -0
  97. package/build/internal/es/src/stores-v2-inventory-inventory.http.js.map +1 -0
  98. package/build/internal/es/src/stores-v2-inventory-inventory.meta.d.ts +21 -0
  99. package/build/internal/es/src/stores-v2-inventory-inventory.meta.js +94 -0
  100. package/build/internal/es/src/stores-v2-inventory-inventory.meta.js.map +1 -0
  101. package/build/internal/es/src/stores-v2-inventory-inventory.public.d.ts +60 -0
  102. package/build/internal/es/src/stores-v2-inventory-inventory.public.js +50 -0
  103. package/build/internal/es/src/stores-v2-inventory-inventory.public.js.map +1 -0
  104. package/build/internal/es/src/stores-v2-inventory-inventory.types.d.ts +358 -0
  105. package/build/internal/es/src/stores-v2-inventory-inventory.types.js +20 -0
  106. package/build/internal/es/src/stores-v2-inventory-inventory.types.js.map +1 -0
  107. package/build/internal/es/src/stores-v2-inventory-inventory.universal.d.ts +563 -0
  108. package/build/internal/es/src/stores-v2-inventory-inventory.universal.js +238 -0
  109. package/build/internal/es/src/stores-v2-inventory-inventory.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,60 @@
1
+ import { EventDefinition, HttpClient } from '@wix/sdk-types';
2
+ import { DecrementData, GetInventoryVariantsOptions, GetInventoryVariantsResponse, GetInventoryVariantsResponseNonNullableFields, IncrementData, InventoryItemChangedEnvelope, InventoryVariantsChangedEnvelope, QueryInventoryOptions, QueryInventoryResponse, QueryInventoryResponseNonNullableFields, UpdateInventoryVariantsInventoryItem } from './stores-v2-inventory-inventory.universal.js';
3
+ export declare const __metadata: {
4
+ PACKAGE_NAME: string;
5
+ };
6
+ export declare function getInventoryVariants(httpClient: HttpClient): GetInventoryVariantsSignature;
7
+ interface GetInventoryVariantsSignature {
8
+ /**
9
+ * Gets inventory variant information based on the specified option choices.
10
+ *
11
+ *
12
+ * The `getInventoryVariants()` function returns a Promise that resolves to the specified inventory variant information.
13
+ * @param - Inventory item ID.
14
+ */
15
+ (inventoryId: string, options?: GetInventoryVariantsOptions | undefined): Promise<GetInventoryVariantsResponse & GetInventoryVariantsResponseNonNullableFields>;
16
+ }
17
+ export declare function queryInventory(httpClient: HttpClient): QueryInventorySignature;
18
+ interface QueryInventorySignature {
19
+ /**
20
+ * Returns a list of inventory items, given the provided paging, sorting and filtering.
21
+ */
22
+ (options?: QueryInventoryOptions | undefined): Promise<QueryInventoryResponse & QueryInventoryResponseNonNullableFields>;
23
+ }
24
+ export declare function updateInventoryVariants(httpClient: HttpClient): UpdateInventoryVariantsSignature;
25
+ interface UpdateInventoryVariantsSignature {
26
+ /**
27
+ * Updates product inventory, including total quantity, whether the product is in stock, and whether the product inventory is tracked.
28
+ *
29
+ *
30
+ * The `updateInventoryVariants()` function is a Promise that resolves to the updated inventory variant data.
31
+ * @param - Product ID.
32
+ * @param - Inventory item to update.
33
+ */
34
+ (productId: string | null, inventoryItem: UpdateInventoryVariantsInventoryItem): Promise<void>;
35
+ }
36
+ export declare function decrementInventory(httpClient: HttpClient): DecrementInventorySignature;
37
+ interface DecrementInventorySignature {
38
+ /**
39
+ * Subtracts a set number of items from inventory.
40
+ *
41
+ *
42
+ * The `decrementInventory()` function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory.
43
+ * @param - Item or product to decrement.
44
+ */
45
+ (decrementData: DecrementData[]): Promise<void>;
46
+ }
47
+ export declare function incrementInventory(httpClient: HttpClient): IncrementInventorySignature;
48
+ interface IncrementInventorySignature {
49
+ /**
50
+ * Adds a set number of items to inventory.
51
+ *
52
+ *
53
+ * The `incrementInventory()` function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory.
54
+ * @param - Item or product to increment.
55
+ */
56
+ (incrementData: IncrementData[]): Promise<void>;
57
+ }
58
+ export declare const onInventoryItemChanged: EventDefinition<InventoryItemChangedEnvelope, "com.wix.ecommerce.inventory.api.v1.InventoryItemChanged">;
59
+ export declare const onInventoryVariantsChanged: EventDefinition<InventoryVariantsChangedEnvelope, "com.wix.ecommerce.inventory.api.v1.InventoryVariantsChanged">;
60
+ export { BaseEventMetadata, BulkUpdateInventoryItemsRequest, BulkUpdateInventoryItemsResponse, BulkUpdateInventoryVariantsRequest, BulkUpdateInventoryVariantsRequestActionOneOf, BulkUpdateInventoryVariantsResponse, ChangedInventoryVariant, ChangedInventoryVariantData, DecrementData, DecrementDataIdOneOf, DecrementInventoryRequest, DecrementInventoryResponse, GetInventoryItemsRequest, GetInventoryItemsResponse, GetInventoryVariantsOptions, GetInventoryVariantsRequest, GetInventoryVariantsRequestIdOneOf, GetInventoryVariantsResponse, GetInventoryVariantsResponseNonNullableFields, IdentificationData, IdentificationDataIdOneOf, IncrementData, IncrementDataIdOneOf, IncrementInventoryRequest, IncrementInventoryResponse, InventoryItemChanged, InventoryItemChangedEnvelope, InventoryItemV2, InventoryVariantV2, InventoryVariantsChanged, InventoryVariantsChangedEnvelope, MessageEnvelope, Paging, PagingMetadata, PreorderInfo, Query, QueryInventoryOptions, QueryInventoryRequest, QueryInventoryResponse, QueryInventoryResponseNonNullableFields, ReasonType, UpdateInventoryVariantsInventoryItem, UpdateInventoryVariantsRequest, UpdateInventoryVariantsResponse, WebhookIdentityType, } from './stores-v2-inventory-inventory.universal.js';
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookIdentityType = exports.ReasonType = exports.onInventoryVariantsChanged = exports.onInventoryItemChanged = exports.incrementInventory = exports.decrementInventory = exports.updateInventoryVariants = exports.queryInventory = exports.getInventoryVariants = exports.__metadata = void 0;
4
+ const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
5
+ const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
6
+ const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
7
+ const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
8
+ const sdk_types_1 = require("@wix/sdk-types");
9
+ const stores_v2_inventory_inventory_universal_js_1 = require("./stores-v2-inventory-inventory.universal.js");
10
+ exports.__metadata = { PACKAGE_NAME: '@wix/stores' };
11
+ function getInventoryVariants(httpClient) {
12
+ return (inventoryId, options) => (0, stores_v2_inventory_inventory_universal_js_1.getInventoryVariants)(inventoryId, options,
13
+ // @ts-ignore
14
+ { httpClient });
15
+ }
16
+ exports.getInventoryVariants = getInventoryVariants;
17
+ function queryInventory(httpClient) {
18
+ return (options) => (0, stores_v2_inventory_inventory_universal_js_1.queryInventory)(options,
19
+ // @ts-ignore
20
+ { httpClient });
21
+ }
22
+ exports.queryInventory = queryInventory;
23
+ function updateInventoryVariants(httpClient) {
24
+ return (productId, inventoryItem) => (0, stores_v2_inventory_inventory_universal_js_1.updateInventoryVariants)(productId, inventoryItem,
25
+ // @ts-ignore
26
+ { httpClient });
27
+ }
28
+ exports.updateInventoryVariants = updateInventoryVariants;
29
+ function decrementInventory(httpClient) {
30
+ return (decrementData) => (0, stores_v2_inventory_inventory_universal_js_1.decrementInventory)(decrementData,
31
+ // @ts-ignore
32
+ { httpClient });
33
+ }
34
+ exports.decrementInventory = decrementInventory;
35
+ function incrementInventory(httpClient) {
36
+ return (incrementData) => (0, stores_v2_inventory_inventory_universal_js_1.incrementInventory)(incrementData,
37
+ // @ts-ignore
38
+ { httpClient });
39
+ }
40
+ exports.incrementInventory = incrementInventory;
41
+ exports.onInventoryItemChanged = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.inventory.api.v1.InventoryItemChanged', false, (event) => (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(event, [
42
+ {
43
+ transformFn: field_mask_1.transformRESTFieldMaskToSDKFieldMask,
44
+ paths: [{ path: 'data.fieldMask' }],
45
+ },
46
+ {
47
+ transformFn: timestamp_1.transformRESTTimestampToSDKTimestamp,
48
+ paths: [{ path: 'data.updatedDate' }],
49
+ },
50
+ ])))();
51
+ exports.onInventoryVariantsChanged = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.inventory.api.v1.InventoryVariantsChanged', false, (event) => (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(event, [
52
+ {
53
+ transformFn: timestamp_1.transformRESTTimestampToSDKTimestamp,
54
+ paths: [{ path: 'data.updatedDate' }],
55
+ },
56
+ ])))();
57
+ var stores_v2_inventory_inventory_universal_js_2 = require("./stores-v2-inventory-inventory.universal.js");
58
+ Object.defineProperty(exports, "ReasonType", { enumerable: true, get: function () { return stores_v2_inventory_inventory_universal_js_2.ReasonType; } });
59
+ Object.defineProperty(exports, "WebhookIdentityType", { enumerable: true, get: function () { return stores_v2_inventory_inventory_universal_js_2.WebhookIdentityType; } });
60
+ //# sourceMappingURL=stores-v2-inventory-inventory.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores-v2-inventory-inventory.public.js","sourceRoot":"","sources":["../../../src/stores-v2-inventory-inventory.public.ts"],"names":[],"mappings":";;;AAAA,oFAAkG;AAClG,4EAAmG;AACnG,0EAAkG;AAClG,sFAAkF;AAClF,8CAA6D;AAC7D,6GAiBsD;AAEzC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AAE1D,SAAgB,oBAAoB,CAClC,UAAsB;IAEtB,OAAO,CAAC,WAAmB,EAAE,OAAqC,EAAE,EAAE,CACpE,IAAA,iEAA6B,EAC3B,WAAW,EACX,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAVD,oDAUC;AAkBD,SAAgB,cAAc,CAC5B,UAAsB;IAEtB,OAAO,CAAC,OAA+B,EAAE,EAAE,CACzC,IAAA,2DAAuB,EACrB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AATD,wCASC;AAWD,SAAgB,uBAAuB,CACrC,UAAsB;IAEtB,OAAO,CACL,SAAwB,EACxB,aAAmD,EACnD,EAAE,CACF,IAAA,oEAAgC,EAC9B,SAAS,EACT,aAAa;IACb,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAbD,0DAaC;AAiBD,SAAgB,kBAAkB,CAChC,UAAsB;IAEtB,OAAO,CAAC,aAA8B,EAAE,EAAE,CACxC,IAAA,+DAA2B,EACzB,aAAa;IACb,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AATD,gDASC;AAaD,SAAgB,kBAAkB,CAChC,UAAsB;IAEtB,OAAO,CAAC,aAA8B,EAAE,EAAE,CACxC,IAAA,+DAA2B,EACzB,aAAa;IACb,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AATD,gDASC;AAaY,QAAA,sBAAsB,GAAG,IAAA,2BAAe,EACnD,yDAAyD,EACzD,KAAK,EACL,CAAC,KAAmC,EAAE,EAAE,CACtC,IAAA,gEAAuC,EACrC,IAAA,gCAAc,EAAC,KAAK,EAAE;IACpB;QACE,WAAW,EAAE,iDAAoC;QACjD,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;KACpC;IACD;QACE,WAAW,EAAE,gDAAoC;QACjD,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;KACtC;CACF,CAAC,CACH,CACJ,EAAgC,CAAC;AACrB,QAAA,0BAA0B,GAAG,IAAA,2BAAe,EACvD,6DAA6D,EAC7D,KAAK,EACL,CAAC,KAAuC,EAAE,EAAE,CAC1C,IAAA,gEAAuC,EACrC,IAAA,gCAAc,EAAC,KAAK,EAAE;IACpB;QACE,WAAW,EAAE,gDAAoC;QACjD,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;KACtC;CACF,CAAC,CACH,CACJ,EAAoC,CAAC;AAEtC,2GA8CsD;AALpD,wIAAA,UAAU,OAAA;AAIV,iJAAA,mBAAmB,OAAA"}
@@ -0,0 +1,358 @@
1
+ export interface InventoryItemV2 {
2
+ /** Inventory item ID. */
3
+ id?: string | null;
4
+ /**
5
+ * Deprecated: use productId.
6
+ * @readonly
7
+ * @deprecated Deprecated: use productId.
8
+ * @replacedBy product_id
9
+ * @targetRemovalDate 2024-12-31
10
+ */
11
+ externalId?: string | null;
12
+ /**
13
+ * Product ID.
14
+ * @readonly
15
+ */
16
+ productId?: string | null;
17
+ /** Whether quantity is being tracked. */
18
+ trackQuantity?: boolean | null;
19
+ /** Variants associated with this inventory item. */
20
+ variants?: InventoryVariantV2[];
21
+ /**
22
+ * Last updated timestamp.
23
+ * @readonly
24
+ */
25
+ lastUpdated?: Date | null;
26
+ /**
27
+ * Inventory’s unique numeric ID (assigned in ascending order).
28
+ * Primarily for sorting and filtering when crawling all inventories.
29
+ * @readonly
30
+ */
31
+ numericId?: string;
32
+ /** Preorder information. */
33
+ preorderInfo?: PreorderInfo;
34
+ }
35
+ export interface InventoryVariantV2 {
36
+ /** Variant ID. */
37
+ variantId?: string;
38
+ /** Whether the product is listed as in stock. */
39
+ inStock?: boolean | null;
40
+ /** Quantity currently left in inventory. */
41
+ quantity?: number | null;
42
+ /**
43
+ * Whether the variant is available for preorder. When `true`, the variant is out of stock and preorder is enabled on inventory level.
44
+ * @readonly
45
+ */
46
+ availableForPreorder?: boolean;
47
+ }
48
+ export interface PreorderInfo {
49
+ /** Whether the item is available for preorder. */
50
+ enabled?: boolean;
51
+ /** A message the buyer will see when the item is out of stock and preorder is enabled. */
52
+ message?: string | null;
53
+ /** Number of products that can be preordered after stock reaches zero. */
54
+ limit?: number | null;
55
+ }
56
+ export interface InventoryItemChanged {
57
+ /** Inventory item ID. */
58
+ inventoryItemId?: string;
59
+ /**
60
+ * Deprecated: use productId.
61
+ * @deprecated Deprecated: use productId.
62
+ * @replacedBy product_id
63
+ * @targetRemovalDate 2024-12-31
64
+ */
65
+ externalId?: string;
66
+ /** Product ID. */
67
+ productId?: string;
68
+ /** Whether inventory is being tracked. */
69
+ trackInventory?: boolean;
70
+ /** Preorder information. */
71
+ preorderInfo?: PreorderInfo;
72
+ /** Field mask of updated fields. */
73
+ fieldMask?: string[];
74
+ /** Date and time the inventory item was last updated. */
75
+ updatedDate?: Date | null;
76
+ }
77
+ export interface InventoryVariantsChanged {
78
+ /** Inventory item ID. */
79
+ inventoryItemId?: string;
80
+ /**
81
+ * Deprecated: use productId.
82
+ * @deprecated Deprecated: use productId.
83
+ * @replacedBy product_id
84
+ * @targetRemovalDate 2024-12-31
85
+ */
86
+ externalId?: string;
87
+ /** Product ID. */
88
+ productId?: string;
89
+ /** Information about changed variants. */
90
+ variants?: ChangedInventoryVariant[];
91
+ /** Date and time the inventory variant item was last updated. */
92
+ updatedDate?: Date | null;
93
+ }
94
+ export interface ChangedInventoryVariant {
95
+ /** Variant ID. */
96
+ id?: string;
97
+ /** Previous inventory variant data. */
98
+ oldValue?: ChangedInventoryVariantData;
99
+ /** Current inventory variant data. */
100
+ newValue?: ChangedInventoryVariantData;
101
+ }
102
+ export interface ChangedInventoryVariantData {
103
+ /** Inventory variant quantity. */
104
+ quantity?: number | null;
105
+ /** Whether the product variant is in stock. */
106
+ inStock?: boolean;
107
+ /** Whether the variant is available for preorder. When `true`, the variant is out of stock and preorder is enabled on inventory level. */
108
+ availableForPreorder?: boolean;
109
+ }
110
+ export declare enum ReasonType {
111
+ /** Unknown reason. */
112
+ UNKNOWN = "UNKNOWN",
113
+ /** Order related. */
114
+ ORDER = "ORDER",
115
+ /** Manual adjustment. */
116
+ MANUAL = "MANUAL",
117
+ /** Reverting an inventory change. */
118
+ REVERT_INVENTORY_CHANGE = "REVERT_INVENTORY_CHANGE"
119
+ }
120
+ export interface GetInventoryVariantsRequest extends GetInventoryVariantsRequestIdOneOf {
121
+ /** Inventory item ID. */
122
+ inventoryId: string;
123
+ /**
124
+ * Deprecated (use productID instead).
125
+ * @deprecated Deprecated (use productID instead).
126
+ * @replacedBy product_id
127
+ * @targetRemovalDate 2024-12-31
128
+ */
129
+ externalId?: string;
130
+ /** Product ID. */
131
+ productId?: string;
132
+ /** Variant IDs to query for this inventory item (optional). */
133
+ variantIds?: string[];
134
+ }
135
+ /** @oneof */
136
+ export interface GetInventoryVariantsRequestIdOneOf {
137
+ /** Inventory item ID. */
138
+ inventoryId?: string;
139
+ /**
140
+ * Deprecated (use productID instead).
141
+ * @deprecated Deprecated (use productID instead).
142
+ * @replacedBy product_id
143
+ * @targetRemovalDate 2024-12-31
144
+ */
145
+ externalId?: string;
146
+ /** Product ID. */
147
+ productId?: string;
148
+ }
149
+ export interface GetInventoryVariantsResponse {
150
+ /** Inventory item. */
151
+ inventoryItem?: InventoryItemV2;
152
+ }
153
+ export interface GetInventoryItemsRequest {
154
+ /** Product IDs */
155
+ productIds?: string[];
156
+ }
157
+ export interface GetInventoryItemsResponse {
158
+ /** Inventory items. */
159
+ inventoryItems?: InventoryItemV2[];
160
+ }
161
+ export interface QueryInventoryRequest {
162
+ query?: Query;
163
+ }
164
+ export interface Query {
165
+ paging?: Paging;
166
+ /** Filter string */
167
+ filter?: string | null;
168
+ /** Sort string */
169
+ sort?: string | null;
170
+ }
171
+ export interface Paging {
172
+ /** Amount of items to load per page */
173
+ limit?: number | null;
174
+ /** Number of items to skip in the display (relevant for all pages after the first) */
175
+ offset?: number | null;
176
+ }
177
+ export interface QueryInventoryResponse {
178
+ /** Inventory items. */
179
+ inventoryItems?: InventoryItemV2[];
180
+ /** Display metadata. */
181
+ metadata?: PagingMetadata;
182
+ /** Number of total results. */
183
+ totalResults?: number;
184
+ }
185
+ export interface PagingMetadata {
186
+ /** Amount of items to load per page */
187
+ items?: number;
188
+ /** Number of items to skip in the display (relevant for all pages after the first) */
189
+ offset?: number;
190
+ }
191
+ export interface MessageEnvelope {
192
+ /** App instance ID. */
193
+ instanceId?: string | null;
194
+ /** Event type. */
195
+ eventType?: string;
196
+ /** The identification type and identity data. */
197
+ identity?: IdentificationData;
198
+ /** Stringify payload. */
199
+ data?: string;
200
+ }
201
+ export interface IdentificationData extends IdentificationDataIdOneOf {
202
+ /** ID of a site visitor that has not logged in to the site. */
203
+ anonymousVisitorId?: string;
204
+ /** ID of a site visitor that has logged in to the site. */
205
+ memberId?: string;
206
+ /** ID of a Wix user (site owner, contributor, etc.). */
207
+ wixUserId?: string;
208
+ /** ID of an app. */
209
+ appId?: string;
210
+ /** @readonly */
211
+ identityType?: WebhookIdentityType;
212
+ }
213
+ /** @oneof */
214
+ export interface IdentificationDataIdOneOf {
215
+ /** ID of a site visitor that has not logged in to the site. */
216
+ anonymousVisitorId?: string;
217
+ /** ID of a site visitor that has logged in to the site. */
218
+ memberId?: string;
219
+ /** ID of a Wix user (site owner, contributor, etc.). */
220
+ wixUserId?: string;
221
+ /** ID of an app. */
222
+ appId?: string;
223
+ }
224
+ export declare enum WebhookIdentityType {
225
+ UNKNOWN = "UNKNOWN",
226
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
227
+ MEMBER = "MEMBER",
228
+ WIX_USER = "WIX_USER",
229
+ APP = "APP"
230
+ }
231
+ export interface UpdateInventoryVariantsRequest {
232
+ /** Inventory item. */
233
+ inventoryItem: InventoryItemV2;
234
+ }
235
+ export interface UpdateInventoryVariantsResponse {
236
+ }
237
+ export interface BulkUpdateInventoryVariantsRequest extends BulkUpdateInventoryVariantsRequestActionOneOf {
238
+ /** Change availability. */
239
+ setInStock?: boolean | null;
240
+ /** Set new quantity. */
241
+ setQuantity?: number | null;
242
+ /** Number to increment inventory by. */
243
+ incrementBy?: number | null;
244
+ /** Number to decrement inventory by. */
245
+ decrementBy?: number | null;
246
+ /** Variants filter. Learn more about [API query language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language). */
247
+ filter?: Record<string, any> | null;
248
+ }
249
+ /** @oneof */
250
+ export interface BulkUpdateInventoryVariantsRequestActionOneOf {
251
+ /** Change availability. */
252
+ setInStock?: boolean | null;
253
+ /** Set new quantity. */
254
+ setQuantity?: number | null;
255
+ /** Number to increment inventory by. */
256
+ incrementBy?: number | null;
257
+ /** Number to decrement inventory by. */
258
+ decrementBy?: number | null;
259
+ }
260
+ export interface BulkUpdateInventoryVariantsResponse {
261
+ }
262
+ export interface BulkUpdateInventoryItemsRequest {
263
+ /** Variants filter */
264
+ variantsFilter?: Record<string, any> | null;
265
+ /** Whether inventory is being tracked. */
266
+ trackInventory?: boolean | null;
267
+ }
268
+ export interface BulkUpdateInventoryItemsResponse {
269
+ }
270
+ export interface DecrementInventoryRequest {
271
+ decrementData?: DecrementData[];
272
+ }
273
+ export interface DecrementData extends DecrementDataIdOneOf {
274
+ /** Inventory item ID. */
275
+ inventoryId?: string;
276
+ /**
277
+ * Deprecated: use productId.
278
+ * @deprecated Deprecated: use productId.
279
+ * @replacedBy product_id
280
+ * @targetRemovalDate 2024-12-31
281
+ */
282
+ externalId?: string;
283
+ /** Product ID. */
284
+ productId?: string;
285
+ /** Variant ID. */
286
+ variantId?: string;
287
+ /** Number to decrement inventory by. */
288
+ decrementBy?: number;
289
+ /**
290
+ * Whether the request to decrement the item's inventory was made as part of a purchase that includes preorder items.
291
+ * If true and the item is available for preorder, we allow negative inventory.
292
+ * If false and the item is not available for preorder, we allow regular buy flow (no negative inventory).
293
+ */
294
+ preorderRequest?: boolean;
295
+ }
296
+ /** @oneof */
297
+ export interface DecrementDataIdOneOf {
298
+ /** Inventory item ID. */
299
+ inventoryId?: string;
300
+ /**
301
+ * Deprecated: use productId.
302
+ * @deprecated Deprecated: use productId.
303
+ * @replacedBy product_id
304
+ * @targetRemovalDate 2024-12-31
305
+ */
306
+ externalId?: string;
307
+ /** Product ID. */
308
+ productId?: string;
309
+ }
310
+ export interface DecrementInventoryResponse {
311
+ }
312
+ export interface IncrementInventoryRequest {
313
+ incrementData?: IncrementData[];
314
+ }
315
+ export interface IncrementData extends IncrementDataIdOneOf {
316
+ /** Inventory item ID. */
317
+ inventoryId?: string;
318
+ /** Product ID. */
319
+ productId?: string;
320
+ /** Variant ID. */
321
+ variantId?: string;
322
+ /** Number to increment inventory by. */
323
+ incrementBy?: number;
324
+ }
325
+ /** @oneof */
326
+ export interface IncrementDataIdOneOf {
327
+ /** Inventory item ID. */
328
+ inventoryId?: string;
329
+ /** Product ID. */
330
+ productId?: string;
331
+ }
332
+ export interface IncrementInventoryResponse {
333
+ }
334
+ interface InventoryVariantV2NonNullableFields {
335
+ variantId: string;
336
+ availableForPreorder: boolean;
337
+ }
338
+ interface PreorderInfoNonNullableFields {
339
+ enabled: boolean;
340
+ }
341
+ interface InventoryItemV2NonNullableFields {
342
+ variants: InventoryVariantV2NonNullableFields[];
343
+ numericId: string;
344
+ preorderInfo?: PreorderInfoNonNullableFields;
345
+ }
346
+ export interface GetInventoryVariantsResponseNonNullableFields {
347
+ inventoryItem?: InventoryItemV2NonNullableFields;
348
+ }
349
+ interface PagingMetadataNonNullableFields {
350
+ items: number;
351
+ offset: number;
352
+ }
353
+ export interface QueryInventoryResponseNonNullableFields {
354
+ inventoryItems: InventoryItemV2NonNullableFields[];
355
+ metadata?: PagingMetadataNonNullableFields;
356
+ totalResults: number;
357
+ }
358
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookIdentityType = exports.ReasonType = void 0;
4
+ var ReasonType;
5
+ (function (ReasonType) {
6
+ /** Unknown reason. */
7
+ ReasonType["UNKNOWN"] = "UNKNOWN";
8
+ /** Order related. */
9
+ ReasonType["ORDER"] = "ORDER";
10
+ /** Manual adjustment. */
11
+ ReasonType["MANUAL"] = "MANUAL";
12
+ /** Reverting an inventory change. */
13
+ ReasonType["REVERT_INVENTORY_CHANGE"] = "REVERT_INVENTORY_CHANGE";
14
+ })(ReasonType || (exports.ReasonType = ReasonType = {}));
15
+ var WebhookIdentityType;
16
+ (function (WebhookIdentityType) {
17
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
18
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
19
+ WebhookIdentityType["MEMBER"] = "MEMBER";
20
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
21
+ WebhookIdentityType["APP"] = "APP";
22
+ })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
23
+ //# sourceMappingURL=stores-v2-inventory-inventory.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores-v2-inventory-inventory.types.js","sourceRoot":"","sources":["../../../src/stores-v2-inventory-inventory.types.ts"],"names":[],"mappings":";;;AAoHA,IAAY,UASX;AATD,WAAY,UAAU;IACpB,sBAAsB;IACtB,iCAAmB,CAAA;IACnB,qBAAqB;IACrB,6BAAe,CAAA;IACf,yBAAyB;IACzB,+BAAiB,CAAA;IACjB,qCAAqC;IACrC,iEAAmD,CAAA;AACrD,CAAC,EATW,UAAU,0BAAV,UAAU,QASrB;AAwHD,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,kCAAW,CAAA;AACb,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B"}