@wix/auto_sdk_stores_inventory 1.0.42 → 1.0.44

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 (37) hide show
  1. package/build/cjs/index.d.ts +21 -21
  2. package/build/cjs/index.js +171 -171
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +201 -197
  5. package/build/cjs/index.typings.js +154 -154
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +180 -178
  8. package/build/cjs/meta.js +140 -140
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +21 -21
  11. package/build/es/index.mjs +171 -171
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +201 -197
  14. package/build/es/index.typings.mjs +154 -154
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +180 -178
  17. package/build/es/meta.mjs +140 -140
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +21 -21
  20. package/build/internal/cjs/index.js +171 -171
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +234 -230
  23. package/build/internal/cjs/index.typings.js +154 -154
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +180 -178
  26. package/build/internal/cjs/meta.js +140 -140
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +21 -21
  29. package/build/internal/es/index.mjs +171 -171
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +234 -230
  32. package/build/internal/es/index.typings.mjs +154 -154
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +180 -178
  35. package/build/internal/es/meta.mjs +140 -140
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -1,7 +1,25 @@
1
1
  import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { UpdateInventoryVariantsInventoryItem, DecrementData, IncrementData, GetInventoryVariantsOptions, GetInventoryVariantsResponse, QueryInventoryOptions, QueryInventoryResponse, InventoryItemChangedEnvelope, InventoryVariantsChangedEnvelope } from './index.typings.js';
2
+ import { GetInventoryVariantsOptions, GetInventoryVariantsResponse, QueryInventoryOptions, QueryInventoryResponse, UpdateInventoryVariantsInventoryItem, DecrementData, IncrementData, InventoryItemChangedEnvelope, InventoryVariantsChangedEnvelope } from './index.typings.js';
3
3
  export { AccountInfo, BaseEventMetadata, BulkUpdateInventoryItemsRequest, BulkUpdateInventoryItemsResponse, BulkUpdateInventoryVariantsRequest, BulkUpdateInventoryVariantsRequestActionOneOf, BulkUpdateInventoryVariantsResponse, ChangedInventoryVariant, ChangedInventoryVariantData, DecrementDataIdOneOf, DecrementInventoryRequest, DecrementInventoryResponse, GetInventoryItemsRequest, GetInventoryItemsResponse, GetInventoryVariantsOptionsIdOneOf, GetInventoryVariantsRequest, GetInventoryVariantsRequestIdOneOf, IdentificationData, IdentificationDataIdOneOf, IncrementDataIdOneOf, IncrementInventoryRequest, IncrementInventoryResponse, InventoryItemChanged, InventoryItemV2, InventoryVariantV2, InventoryVariantsChanged, MessageEnvelope, Paging, PagingMetadata, PreorderInfo, Query, QueryInventoryRequest, ReasonType, ReasonTypeWithLiterals, UpdateInventoryVariantsRequest, UpdateInventoryVariantsResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
+ declare function getInventoryVariants$1(httpClient: HttpClient): GetInventoryVariantsSignature;
6
+ interface GetInventoryVariantsSignature {
7
+ /**
8
+ * Gets inventory variant information based on the specified option choices.
9
+ *
10
+ *
11
+ * The `getInventoryVariants()` function returns a Promise that resolves to the specified inventory variant information.
12
+ * @param - Inventory item ID.
13
+ */
14
+ (inventoryId: string, options?: GetInventoryVariantsOptions): Promise<NonNullablePaths<GetInventoryVariantsResponse, `inventoryItem.variants` | `inventoryItem.variants.${number}.variantId` | `inventoryItem.variants.${number}.availableForPreorder` | `inventoryItem.numericId` | `inventoryItem.preorderInfo.enabled`, 5>>;
15
+ }
16
+ declare function queryInventory$1(httpClient: HttpClient): QueryInventorySignature;
17
+ interface QueryInventorySignature {
18
+ /**
19
+ * Returns a list of inventory items, given the provided paging, sorting and filtering.
20
+ */
21
+ (options?: QueryInventoryOptions): Promise<NonNullablePaths<QueryInventoryResponse, `inventoryItems` | `inventoryItems.${number}.numericId` | `inventoryItems.${number}.preorderInfo.enabled` | `metadata.items` | `metadata.offset` | `totalResults`, 5>>;
22
+ }
5
23
  declare function updateInventoryVariants$1(httpClient: HttpClient): UpdateInventoryVariantsSignature;
6
24
  interface UpdateInventoryVariantsSignature {
7
25
  /**
@@ -36,32 +54,14 @@ interface IncrementInventorySignature {
36
54
  */
37
55
  (incrementData: IncrementData[]): Promise<void>;
38
56
  }
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): Promise<NonNullablePaths<GetInventoryVariantsResponse, `inventoryItem.variants` | `inventoryItem.variants.${number}.variantId` | `inventoryItem.variants.${number}.availableForPreorder` | `inventoryItem.numericId` | `inventoryItem.preorderInfo.enabled`, 5>>;
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): Promise<NonNullablePaths<QueryInventoryResponse, `inventoryItems` | `inventoryItems.${number}.numericId` | `inventoryItems.${number}.preorderInfo.enabled` | `metadata.items` | `metadata.offset` | `totalResults`, 5>>;
56
- }
57
57
  declare const onInventoryItemChanged$1: EventDefinition<InventoryItemChangedEnvelope, "com.wix.ecommerce.inventory.api.v1.InventoryItemChanged">;
58
58
  declare const onInventoryVariantsChanged$1: EventDefinition<InventoryVariantsChangedEnvelope, "com.wix.ecommerce.inventory.api.v1.InventoryVariantsChanged">;
59
59
 
60
+ declare const getInventoryVariants: MaybeContext<BuildRESTFunction<typeof getInventoryVariants$1> & typeof getInventoryVariants$1>;
61
+ declare const queryInventory: MaybeContext<BuildRESTFunction<typeof queryInventory$1> & typeof queryInventory$1>;
60
62
  declare const updateInventoryVariants: MaybeContext<BuildRESTFunction<typeof updateInventoryVariants$1> & typeof updateInventoryVariants$1>;
61
63
  declare const decrementInventory: MaybeContext<BuildRESTFunction<typeof decrementInventory$1> & typeof decrementInventory$1>;
62
64
  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
65
  /**
66
66
  * Triggered when an inventory item is changed.
67
67
  */
@@ -48,67 +48,6 @@ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
48
48
  var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
49
49
  var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
50
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
51
  function resolveWixInventoryApiV1InventoryWriteApiUrl(opts) {
113
52
  const domainToMappings = {
114
53
  "api._api_base_domain_": [
@@ -192,7 +131,122 @@ function resolveWixInventoryApiV1InventoryWriteApiUrl(opts) {
192
131
  };
193
132
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
194
133
  }
134
+ function resolveWixInventoryApiV1InventoryReadApiUrl(opts) {
135
+ const domainToMappings = {
136
+ "api._api_base_domain_": [
137
+ {
138
+ srcPath: "/wix-ecommerce-catalog-reader-web",
139
+ destPath: ""
140
+ }
141
+ ],
142
+ "manage._base_domain_": [
143
+ {
144
+ srcPath: "/wix-ecommerce-catalog-reader-web",
145
+ destPath: ""
146
+ }
147
+ ],
148
+ "www.wixapis.com": [
149
+ {
150
+ srcPath: "/stores-reader/v2/collections",
151
+ destPath: "/v2/collections"
152
+ },
153
+ {
154
+ srcPath: "/stores-reader/v2/inventoryItems",
155
+ destPath: "/v2/inventoryItems"
156
+ }
157
+ ],
158
+ "www._base_domain_": [
159
+ {
160
+ srcPath: "/wix-ecommerce-catalog-reader-web",
161
+ destPath: ""
162
+ }
163
+ ],
164
+ "editor._base_domain_": [
165
+ {
166
+ srcPath: "/_api/wix-ecommerce-catalog-reader-web",
167
+ destPath: ""
168
+ }
169
+ ],
170
+ "blocks._base_domain_": [
171
+ {
172
+ srcPath: "/_api/wix-ecommerce-catalog-reader-web",
173
+ destPath: ""
174
+ }
175
+ ],
176
+ "create.editorx": [
177
+ {
178
+ srcPath: "/_api/wix-ecommerce-catalog-reader-web",
179
+ destPath: ""
180
+ }
181
+ ],
182
+ _: [
183
+ {
184
+ srcPath: "/stores-reader/v2/inventoryItems",
185
+ destPath: "/v2/inventoryItems"
186
+ },
187
+ {
188
+ srcPath: "/stores-reader/v2/collections",
189
+ destPath: "/v2/collections"
190
+ }
191
+ ]
192
+ };
193
+ return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
194
+ }
195
195
  var PACKAGE_NAME = "@wix/auto_sdk_stores_inventory";
196
+ function getInventoryVariants(payload) {
197
+ function __getInventoryVariants({ host }) {
198
+ const metadata = {
199
+ entityFqdn: "wix.stores.v2.inventory",
200
+ method: "POST",
201
+ methodFqn: "wix.inventory.api.v1.InventoryReadApi.GetInventoryVariants",
202
+ packageName: PACKAGE_NAME,
203
+ migrationOptions: {
204
+ optInTransformResponse: true
205
+ },
206
+ url: resolveWixInventoryApiV1InventoryReadApiUrl({
207
+ protoPath: "/v2/inventoryItems/{inventoryId}/getVariants",
208
+ data: payload,
209
+ host
210
+ }),
211
+ data: payload,
212
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
213
+ {
214
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
215
+ paths: [{ path: "inventoryItem.lastUpdated" }]
216
+ }
217
+ ])
218
+ };
219
+ return metadata;
220
+ }
221
+ return __getInventoryVariants;
222
+ }
223
+ function queryInventory(payload) {
224
+ function __queryInventory({ host }) {
225
+ const metadata = {
226
+ entityFqdn: "wix.stores.v2.inventory",
227
+ method: "POST",
228
+ methodFqn: "wix.inventory.api.v1.InventoryReadApi.QueryInventory",
229
+ packageName: PACKAGE_NAME,
230
+ migrationOptions: {
231
+ optInTransformResponse: true
232
+ },
233
+ url: resolveWixInventoryApiV1InventoryReadApiUrl({
234
+ protoPath: "/v2/inventoryItems/query",
235
+ data: payload,
236
+ host
237
+ }),
238
+ data: payload,
239
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
240
+ {
241
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
242
+ paths: [{ path: "inventoryItems.lastUpdated" }]
243
+ }
244
+ ])
245
+ };
246
+ return metadata;
247
+ }
248
+ return __queryInventory;
249
+ }
196
250
  function updateInventoryVariants(payload) {
197
251
  function __updateInventoryVariants({ host }) {
198
252
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
@@ -262,60 +316,6 @@ function incrementInventory(payload) {
262
316
  }
263
317
  return __incrementInventory;
264
318
  }
265
- function getInventoryVariants(payload) {
266
- function __getInventoryVariants({ host }) {
267
- const metadata = {
268
- entityFqdn: "wix.stores.v2.inventory",
269
- method: "POST",
270
- methodFqn: "wix.inventory.api.v1.InventoryReadApi.GetInventoryVariants",
271
- packageName: PACKAGE_NAME,
272
- migrationOptions: {
273
- optInTransformResponse: true
274
- },
275
- url: resolveWixInventoryApiV1InventoryReadApiUrl({
276
- protoPath: "/v2/inventoryItems/{inventoryId}/getVariants",
277
- data: payload,
278
- host
279
- }),
280
- data: payload,
281
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
282
- {
283
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
284
- paths: [{ path: "inventoryItem.lastUpdated" }]
285
- }
286
- ])
287
- };
288
- return metadata;
289
- }
290
- return __getInventoryVariants;
291
- }
292
- function queryInventory(payload) {
293
- function __queryInventory({ host }) {
294
- const metadata = {
295
- entityFqdn: "wix.stores.v2.inventory",
296
- method: "POST",
297
- methodFqn: "wix.inventory.api.v1.InventoryReadApi.QueryInventory",
298
- packageName: PACKAGE_NAME,
299
- migrationOptions: {
300
- optInTransformResponse: true
301
- },
302
- url: resolveWixInventoryApiV1InventoryReadApiUrl({
303
- protoPath: "/v2/inventoryItems/query",
304
- data: payload,
305
- host
306
- }),
307
- data: payload,
308
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
309
- {
310
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
311
- paths: [{ path: "inventoryItems.lastUpdated" }]
312
- }
313
- ])
314
- };
315
- return metadata;
316
- }
317
- return __queryInventory;
318
- }
319
319
 
320
320
  // src/stores-v2-inventory-inventory.universal.ts
321
321
  var ReasonType = /* @__PURE__ */ ((ReasonType2) => {
@@ -333,60 +333,70 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
333
333
  WebhookIdentityType2["APP"] = "APP";
334
334
  return WebhookIdentityType2;
335
335
  })(WebhookIdentityType || {});
336
- async function updateInventoryVariants2(productId, inventoryItem) {
336
+ async function getInventoryVariants2(inventoryId, options) {
337
337
  const { httpClient, sideEffects } = arguments[2];
338
338
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
339
- inventoryItem: { ...inventoryItem, productId }
339
+ inventoryId,
340
+ externalId: options?.externalId,
341
+ productId: options?.productId,
342
+ variantIds: options?.variantIds
340
343
  });
341
- const reqOpts = updateInventoryVariants(payload);
344
+ const reqOpts = getInventoryVariants(payload);
342
345
  sideEffects?.onSiteCall?.();
343
346
  try {
344
347
  const result = await httpClient.request(reqOpts);
345
348
  sideEffects?.onSuccess?.(result);
349
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
346
350
  } catch (err) {
347
351
  const transformedError = (0, import_transform_error.transformError)(
348
352
  err,
349
353
  {
350
- spreadPathsToArguments: { inventoryItem: "$[1]" },
351
- explicitPathsToArguments: { "inventoryItem.productId": "$[0]" },
354
+ spreadPathsToArguments: {},
355
+ explicitPathsToArguments: {
356
+ inventoryId: "$[0]",
357
+ externalId: "$[1].externalId",
358
+ productId: "$[1].productId",
359
+ variantIds: "$[1].variantIds"
360
+ },
352
361
  singleArgumentUnchanged: false
353
362
  },
354
- ["productId", "inventoryItem"]
363
+ ["inventoryId", "options"]
355
364
  );
356
365
  sideEffects?.onError?.(err);
357
366
  throw transformedError;
358
367
  }
359
368
  }
360
- async function decrementInventory2(decrementData) {
369
+ async function queryInventory2(options) {
361
370
  const { httpClient, sideEffects } = arguments[1];
362
371
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
363
- decrementData
372
+ query: options?.query
364
373
  });
365
- const reqOpts = decrementInventory(payload);
374
+ const reqOpts = queryInventory(payload);
366
375
  sideEffects?.onSiteCall?.();
367
376
  try {
368
377
  const result = await httpClient.request(reqOpts);
369
378
  sideEffects?.onSuccess?.(result);
379
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
370
380
  } catch (err) {
371
381
  const transformedError = (0, import_transform_error.transformError)(
372
382
  err,
373
383
  {
374
384
  spreadPathsToArguments: {},
375
- explicitPathsToArguments: { decrementData: "$[0]" },
385
+ explicitPathsToArguments: { query: "$[0].query" },
376
386
  singleArgumentUnchanged: false
377
387
  },
378
- ["decrementData"]
388
+ ["options"]
379
389
  );
380
390
  sideEffects?.onError?.(err);
381
391
  throw transformedError;
382
392
  }
383
393
  }
384
- async function incrementInventory2(incrementData) {
385
- const { httpClient, sideEffects } = arguments[1];
394
+ async function updateInventoryVariants2(productId, inventoryItem) {
395
+ const { httpClient, sideEffects } = arguments[2];
386
396
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
387
- incrementData
397
+ inventoryItem: { ...inventoryItem, productId }
388
398
  });
389
- const reqOpts = incrementInventory(payload);
399
+ const reqOpts = updateInventoryVariants(payload);
390
400
  sideEffects?.onSiteCall?.();
391
401
  try {
392
402
  const result = await httpClient.request(reqOpts);
@@ -395,69 +405,59 @@ async function incrementInventory2(incrementData) {
395
405
  const transformedError = (0, import_transform_error.transformError)(
396
406
  err,
397
407
  {
398
- spreadPathsToArguments: {},
399
- explicitPathsToArguments: { incrementData: "$[0]" },
408
+ spreadPathsToArguments: { inventoryItem: "$[1]" },
409
+ explicitPathsToArguments: { "inventoryItem.productId": "$[0]" },
400
410
  singleArgumentUnchanged: false
401
411
  },
402
- ["incrementData"]
412
+ ["productId", "inventoryItem"]
403
413
  );
404
414
  sideEffects?.onError?.(err);
405
415
  throw transformedError;
406
416
  }
407
417
  }
408
- async function getInventoryVariants2(inventoryId, options) {
409
- const { httpClient, sideEffects } = arguments[2];
418
+ async function decrementInventory2(decrementData) {
419
+ const { httpClient, sideEffects } = arguments[1];
410
420
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
411
- inventoryId,
412
- externalId: options?.externalId,
413
- productId: options?.productId,
414
- variantIds: options?.variantIds
421
+ decrementData
415
422
  });
416
- const reqOpts = getInventoryVariants(payload);
423
+ const reqOpts = decrementInventory(payload);
417
424
  sideEffects?.onSiteCall?.();
418
425
  try {
419
426
  const result = await httpClient.request(reqOpts);
420
427
  sideEffects?.onSuccess?.(result);
421
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
422
428
  } catch (err) {
423
429
  const transformedError = (0, import_transform_error.transformError)(
424
430
  err,
425
431
  {
426
432
  spreadPathsToArguments: {},
427
- explicitPathsToArguments: {
428
- inventoryId: "$[0]",
429
- externalId: "$[1].externalId",
430
- productId: "$[1].productId",
431
- variantIds: "$[1].variantIds"
432
- },
433
+ explicitPathsToArguments: { decrementData: "$[0]" },
433
434
  singleArgumentUnchanged: false
434
435
  },
435
- ["inventoryId", "options"]
436
+ ["decrementData"]
436
437
  );
437
438
  sideEffects?.onError?.(err);
438
439
  throw transformedError;
439
440
  }
440
441
  }
441
- async function queryInventory2(options) {
442
+ async function incrementInventory2(incrementData) {
442
443
  const { httpClient, sideEffects } = arguments[1];
443
444
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
444
- query: options?.query
445
+ incrementData
445
446
  });
446
- const reqOpts = queryInventory(payload);
447
+ const reqOpts = incrementInventory(payload);
447
448
  sideEffects?.onSiteCall?.();
448
449
  try {
449
450
  const result = await httpClient.request(reqOpts);
450
451
  sideEffects?.onSuccess?.(result);
451
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
452
452
  } catch (err) {
453
453
  const transformedError = (0, import_transform_error.transformError)(
454
454
  err,
455
455
  {
456
456
  spreadPathsToArguments: {},
457
- explicitPathsToArguments: { query: "$[0].query" },
457
+ explicitPathsToArguments: { incrementData: "$[0]" },
458
458
  singleArgumentUnchanged: false
459
459
  },
460
- ["options"]
460
+ ["incrementData"]
461
461
  );
462
462
  sideEffects?.onError?.(err);
463
463
  throw transformedError;
@@ -465,6 +465,21 @@ async function queryInventory2(options) {
465
465
  }
466
466
 
467
467
  // src/stores-v2-inventory-inventory.public.ts
468
+ function getInventoryVariants3(httpClient) {
469
+ return (inventoryId, options) => getInventoryVariants2(
470
+ inventoryId,
471
+ options,
472
+ // @ts-ignore
473
+ { httpClient }
474
+ );
475
+ }
476
+ function queryInventory3(httpClient) {
477
+ return (options) => queryInventory2(
478
+ options,
479
+ // @ts-ignore
480
+ { httpClient }
481
+ );
482
+ }
468
483
  function updateInventoryVariants3(httpClient) {
469
484
  return (productId, inventoryItem) => updateInventoryVariants2(
470
485
  productId,
@@ -487,21 +502,6 @@ function incrementInventory3(httpClient) {
487
502
  { httpClient }
488
503
  );
489
504
  }
490
- function getInventoryVariants3(httpClient) {
491
- return (inventoryId, options) => getInventoryVariants2(
492
- inventoryId,
493
- options,
494
- // @ts-ignore
495
- { httpClient }
496
- );
497
- }
498
- function queryInventory3(httpClient) {
499
- return (options) => queryInventory2(
500
- options,
501
- // @ts-ignore
502
- { httpClient }
503
- );
504
- }
505
505
  var onInventoryItemChanged = (0, import_sdk_types.EventDefinition)(
506
506
  "com.wix.ecommerce.inventory.api.v1.InventoryItemChanged",
507
507
  false,
@@ -534,11 +534,11 @@ var onInventoryVariantsChanged = (0, import_sdk_types.EventDefinition)(
534
534
  // src/stores-v2-inventory-inventory.context.ts
535
535
  var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
536
536
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
537
+ var getInventoryVariants4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(getInventoryVariants3);
538
+ var queryInventory4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(queryInventory3);
537
539
  var updateInventoryVariants4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(updateInventoryVariants3);
538
540
  var decrementInventory4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(decrementInventory3);
539
541
  var incrementInventory4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(incrementInventory3);
540
- var getInventoryVariants4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(getInventoryVariants3);
541
- var queryInventory4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(queryInventory3);
542
542
  var onInventoryItemChanged2 = (0, import_event_definition_modules.createEventModule)(
543
543
  onInventoryItemChanged
544
544
  );