@wix/stores 1.0.134 → 1.0.135

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 (235) hide show
  1. package/build/cjs/context.d.ts +5 -5
  2. package/build/cjs/context.js +5 -5
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +5 -6
  5. package/build/cjs/index.js +6 -7
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +5 -6
  8. package/build/cjs/meta.js +6 -7
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +5 -5
  11. package/build/es/context.js +5 -5
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +5 -6
  14. package/build/es/index.js +5 -6
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +5 -6
  17. package/build/es/meta.js +5 -6
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +15 -9
  20. package/build/cjs/index.typings.d.ts +0 -6
  21. package/build/cjs/index.typings.js +0 -33
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/platform-v1-wishlist.context.d.ts +0 -3
  24. package/build/cjs/src/platform-v1-wishlist.context.js +0 -22
  25. package/build/cjs/src/platform-v1-wishlist.context.js.map +0 -1
  26. package/build/cjs/src/platform-v1-wishlist.http.d.ts +0 -3
  27. package/build/cjs/src/platform-v1-wishlist.http.js +0 -91
  28. package/build/cjs/src/platform-v1-wishlist.http.js.map +0 -1
  29. package/build/cjs/src/platform-v1-wishlist.meta.d.ts +0 -13
  30. package/build/cjs/src/platform-v1-wishlist.meta.js +0 -47
  31. package/build/cjs/src/platform-v1-wishlist.meta.js.map +0 -1
  32. package/build/cjs/src/platform-v1-wishlist.public.d.ts +0 -15
  33. package/build/cjs/src/platform-v1-wishlist.public.js +0 -12
  34. package/build/cjs/src/platform-v1-wishlist.public.js.map +0 -1
  35. package/build/cjs/src/platform-v1-wishlist.types.d.ts +0 -104
  36. package/build/cjs/src/platform-v1-wishlist.types.js +0 -3
  37. package/build/cjs/src/platform-v1-wishlist.types.js.map +0 -1
  38. package/build/cjs/src/platform-v1-wishlist.universal.d.ts +0 -121
  39. package/build/cjs/src/platform-v1-wishlist.universal.js +0 -106
  40. package/build/cjs/src/platform-v1-wishlist.universal.js.map +0 -1
  41. package/build/cjs/src/stores-catalog-v1-collection.context.d.ts +0 -5
  42. package/build/cjs/src/stores-catalog-v1-collection.context.js +0 -56
  43. package/build/cjs/src/stores-catalog-v1-collection.context.js.map +0 -1
  44. package/build/cjs/src/stores-catalog-v1-collection.http.d.ts +0 -10
  45. package/build/cjs/src/stores-catalog-v1-collection.http.js +0 -110
  46. package/build/cjs/src/stores-catalog-v1-collection.http.js.map +0 -1
  47. package/build/cjs/src/stores-catalog-v1-collection.meta.d.ts +0 -19
  48. package/build/cjs/src/stores-catalog-v1-collection.meta.js +0 -85
  49. package/build/cjs/src/stores-catalog-v1-collection.meta.js.map +0 -1
  50. package/build/cjs/src/stores-catalog-v1-collection.public.d.ts +0 -59
  51. package/build/cjs/src/stores-catalog-v1-collection.public.js +0 -27
  52. package/build/cjs/src/stores-catalog-v1-collection.public.js.map +0 -1
  53. package/build/cjs/src/stores-catalog-v1-collection.types.d.ts +0 -414
  54. package/build/cjs/src/stores-catalog-v1-collection.types.js +0 -18
  55. package/build/cjs/src/stores-catalog-v1-collection.types.js.map +0 -1
  56. package/build/cjs/src/stores-catalog-v1-collection.universal.d.ts +0 -452
  57. package/build/cjs/src/stores-catalog-v1-collection.universal.js +0 -225
  58. package/build/cjs/src/stores-catalog-v1-collection.universal.js.map +0 -1
  59. package/build/cjs/src/stores-catalog-v1-product.context.d.ts +0 -35
  60. package/build/cjs/src/stores-catalog-v1-product.context.js +0 -566
  61. package/build/cjs/src/stores-catalog-v1-product.context.js.map +0 -1
  62. package/build/cjs/src/stores-catalog-v1-product.http.d.ts +0 -89
  63. package/build/cjs/src/stores-catalog-v1-product.http.js +0 -1716
  64. package/build/cjs/src/stores-catalog-v1-product.http.js.map +0 -1
  65. package/build/cjs/src/stores-catalog-v1-product.meta.d.ts +0 -95
  66. package/build/cjs/src/stores-catalog-v1-product.meta.js +0 -655
  67. package/build/cjs/src/stores-catalog-v1-product.meta.js.map +0 -1
  68. package/build/cjs/src/stores-catalog-v1-product.public.d.ts +0 -1216
  69. package/build/cjs/src/stores-catalog-v1-product.public.js +0 -221
  70. package/build/cjs/src/stores-catalog-v1-product.public.js.map +0 -1
  71. package/build/cjs/src/stores-catalog-v1-product.types.d.ts +0 -4235
  72. package/build/cjs/src/stores-catalog-v1-product.types.js +0 -78
  73. package/build/cjs/src/stores-catalog-v1-product.types.js.map +0 -1
  74. package/build/cjs/src/stores-catalog-v1-product.universal.d.ts +0 -5074
  75. package/build/cjs/src/stores-catalog-v1-product.universal.js +0 -2220
  76. package/build/cjs/src/stores-catalog-v1-product.universal.js.map +0 -1
  77. package/build/cjs/src/stores-v1-abandoned-cart.http.d.ts +0 -6
  78. package/build/cjs/src/stores-v1-abandoned-cart.http.js +0 -103
  79. package/build/cjs/src/stores-v1-abandoned-cart.http.js.map +0 -1
  80. package/build/cjs/src/stores-v1-abandoned-cart.meta.d.ts +0 -16
  81. package/build/cjs/src/stores-v1-abandoned-cart.meta.js +0 -66
  82. package/build/cjs/src/stores-v1-abandoned-cart.meta.js.map +0 -1
  83. package/build/cjs/src/stores-v1-abandoned-cart.public.d.ts +0 -19
  84. package/build/cjs/src/stores-v1-abandoned-cart.public.js +0 -22
  85. package/build/cjs/src/stores-v1-abandoned-cart.public.js.map +0 -1
  86. package/build/cjs/src/stores-v1-abandoned-cart.types.d.ts +0 -216
  87. package/build/cjs/src/stores-v1-abandoned-cart.types.js +0 -30
  88. package/build/cjs/src/stores-v1-abandoned-cart.types.js.map +0 -1
  89. package/build/cjs/src/stores-v1-abandoned-cart.universal.d.ts +0 -246
  90. package/build/cjs/src/stores-v1-abandoned-cart.universal.js +0 -189
  91. package/build/cjs/src/stores-v1-abandoned-cart.universal.js.map +0 -1
  92. package/build/cjs/src/stores-v1-subscription-option.context.d.ts +0 -14
  93. package/build/cjs/src/stores-v1-subscription-option.context.js +0 -209
  94. package/build/cjs/src/stores-v1-subscription-option.context.js.map +0 -1
  95. package/build/cjs/src/stores-v1-subscription-option.http.d.ts +0 -128
  96. package/build/cjs/src/stores-v1-subscription-option.http.js +0 -466
  97. package/build/cjs/src/stores-v1-subscription-option.http.js.map +0 -1
  98. package/build/cjs/src/stores-v1-subscription-option.meta.d.ts +0 -40
  99. package/build/cjs/src/stores-v1-subscription-option.meta.js +0 -258
  100. package/build/cjs/src/stores-v1-subscription-option.meta.js.map +0 -1
  101. package/build/cjs/src/stores-v1-subscription-option.public.d.ts +0 -46
  102. package/build/cjs/src/stores-v1-subscription-option.public.js +0 -81
  103. package/build/cjs/src/stores-v1-subscription-option.public.js.map +0 -1
  104. package/build/cjs/src/stores-v1-subscription-option.types.d.ts +0 -351
  105. package/build/cjs/src/stores-v1-subscription-option.types.js +0 -20
  106. package/build/cjs/src/stores-v1-subscription-option.types.js.map +0 -1
  107. package/build/cjs/src/stores-v1-subscription-option.universal.d.ts +0 -646
  108. package/build/cjs/src/stores-v1-subscription-option.universal.js +0 -893
  109. package/build/cjs/src/stores-v1-subscription-option.universal.js.map +0 -1
  110. package/build/cjs/src/stores-v2-inventory.context.d.ts +0 -7
  111. package/build/cjs/src/stores-v2-inventory.context.js +0 -90
  112. package/build/cjs/src/stores-v2-inventory.context.js.map +0 -1
  113. package/build/cjs/src/stores-v2-inventory.http.d.ts +0 -31
  114. package/build/cjs/src/stores-v2-inventory.http.js +0 -289
  115. package/build/cjs/src/stores-v2-inventory.http.js.map +0 -1
  116. package/build/cjs/src/stores-v2-inventory.meta.d.ts +0 -21
  117. package/build/cjs/src/stores-v2-inventory.meta.js +0 -125
  118. package/build/cjs/src/stores-v2-inventory.meta.js.map +0 -1
  119. package/build/cjs/src/stores-v2-inventory.public.d.ts +0 -13
  120. package/build/cjs/src/stores-v2-inventory.public.js +0 -41
  121. package/build/cjs/src/stores-v2-inventory.public.js.map +0 -1
  122. package/build/cjs/src/stores-v2-inventory.types.d.ts +0 -283
  123. package/build/cjs/src/stores-v2-inventory.types.js +0 -11
  124. package/build/cjs/src/stores-v2-inventory.types.js.map +0 -1
  125. package/build/cjs/src/stores-v2-inventory.universal.d.ts +0 -425
  126. package/build/cjs/src/stores-v2-inventory.universal.js +0 -382
  127. package/build/cjs/src/stores-v2-inventory.universal.js.map +0 -1
  128. package/build/es/index.typings.d.ts +0 -6
  129. package/build/es/index.typings.js +0 -7
  130. package/build/es/index.typings.js.map +0 -1
  131. package/build/es/src/platform-v1-wishlist.context.d.ts +0 -3
  132. package/build/es/src/platform-v1-wishlist.context.js +0 -18
  133. package/build/es/src/platform-v1-wishlist.context.js.map +0 -1
  134. package/build/es/src/platform-v1-wishlist.http.d.ts +0 -3
  135. package/build/es/src/platform-v1-wishlist.http.js +0 -87
  136. package/build/es/src/platform-v1-wishlist.http.js.map +0 -1
  137. package/build/es/src/platform-v1-wishlist.meta.d.ts +0 -13
  138. package/build/es/src/platform-v1-wishlist.meta.js +0 -20
  139. package/build/es/src/platform-v1-wishlist.meta.js.map +0 -1
  140. package/build/es/src/platform-v1-wishlist.public.d.ts +0 -15
  141. package/build/es/src/platform-v1-wishlist.public.js +0 -8
  142. package/build/es/src/platform-v1-wishlist.public.js.map +0 -1
  143. package/build/es/src/platform-v1-wishlist.types.d.ts +0 -104
  144. package/build/es/src/platform-v1-wishlist.types.js +0 -2
  145. package/build/es/src/platform-v1-wishlist.types.js.map +0 -1
  146. package/build/es/src/platform-v1-wishlist.universal.d.ts +0 -121
  147. package/build/es/src/platform-v1-wishlist.universal.js +0 -79
  148. package/build/es/src/platform-v1-wishlist.universal.js.map +0 -1
  149. package/build/es/src/stores-catalog-v1-collection.context.d.ts +0 -5
  150. package/build/es/src/stores-catalog-v1-collection.context.js +0 -50
  151. package/build/es/src/stores-catalog-v1-collection.context.js.map +0 -1
  152. package/build/es/src/stores-catalog-v1-collection.http.d.ts +0 -10
  153. package/build/es/src/stores-catalog-v1-collection.http.js +0 -104
  154. package/build/es/src/stores-catalog-v1-collection.http.js.map +0 -1
  155. package/build/es/src/stores-catalog-v1-collection.meta.d.ts +0 -19
  156. package/build/es/src/stores-catalog-v1-collection.meta.js +0 -56
  157. package/build/es/src/stores-catalog-v1-collection.meta.js.map +0 -1
  158. package/build/es/src/stores-catalog-v1-collection.public.d.ts +0 -59
  159. package/build/es/src/stores-catalog-v1-collection.public.js +0 -19
  160. package/build/es/src/stores-catalog-v1-collection.public.js.map +0 -1
  161. package/build/es/src/stores-catalog-v1-collection.types.d.ts +0 -414
  162. package/build/es/src/stores-catalog-v1-collection.types.js +0 -15
  163. package/build/es/src/stores-catalog-v1-collection.types.js.map +0 -1
  164. package/build/es/src/stores-catalog-v1-collection.universal.d.ts +0 -452
  165. package/build/es/src/stores-catalog-v1-collection.universal.js +0 -196
  166. package/build/es/src/stores-catalog-v1-collection.universal.js.map +0 -1
  167. package/build/es/src/stores-catalog-v1-product.context.d.ts +0 -35
  168. package/build/es/src/stores-catalog-v1-product.context.js +0 -530
  169. package/build/es/src/stores-catalog-v1-product.context.js.map +0 -1
  170. package/build/es/src/stores-catalog-v1-product.http.d.ts +0 -89
  171. package/build/es/src/stores-catalog-v1-product.http.js +0 -1680
  172. package/build/es/src/stores-catalog-v1-product.http.js.map +0 -1
  173. package/build/es/src/stores-catalog-v1-product.meta.d.ts +0 -95
  174. package/build/es/src/stores-catalog-v1-product.meta.js +0 -596
  175. package/build/es/src/stores-catalog-v1-product.meta.js.map +0 -1
  176. package/build/es/src/stores-catalog-v1-product.public.d.ts +0 -1216
  177. package/build/es/src/stores-catalog-v1-product.public.js +0 -170
  178. package/build/es/src/stores-catalog-v1-product.public.js.map +0 -1
  179. package/build/es/src/stores-catalog-v1-product.types.d.ts +0 -4235
  180. package/build/es/src/stores-catalog-v1-product.types.js +0 -75
  181. package/build/es/src/stores-catalog-v1-product.types.js.map +0 -1
  182. package/build/es/src/stores-catalog-v1-product.universal.d.ts +0 -5074
  183. package/build/es/src/stores-catalog-v1-product.universal.js +0 -2161
  184. package/build/es/src/stores-catalog-v1-product.universal.js.map +0 -1
  185. package/build/es/src/stores-v1-abandoned-cart.http.d.ts +0 -6
  186. package/build/es/src/stores-v1-abandoned-cart.http.js +0 -98
  187. package/build/es/src/stores-v1-abandoned-cart.http.js.map +0 -1
  188. package/build/es/src/stores-v1-abandoned-cart.meta.d.ts +0 -16
  189. package/build/es/src/stores-v1-abandoned-cart.meta.js +0 -38
  190. package/build/es/src/stores-v1-abandoned-cart.meta.js.map +0 -1
  191. package/build/es/src/stores-v1-abandoned-cart.public.d.ts +0 -19
  192. package/build/es/src/stores-v1-abandoned-cart.public.js +0 -14
  193. package/build/es/src/stores-v1-abandoned-cart.public.js.map +0 -1
  194. package/build/es/src/stores-v1-abandoned-cart.types.d.ts +0 -216
  195. package/build/es/src/stores-v1-abandoned-cart.types.js +0 -27
  196. package/build/es/src/stores-v1-abandoned-cart.types.js.map +0 -1
  197. package/build/es/src/stores-v1-abandoned-cart.universal.d.ts +0 -246
  198. package/build/es/src/stores-v1-abandoned-cart.universal.js +0 -161
  199. package/build/es/src/stores-v1-abandoned-cart.universal.js.map +0 -1
  200. package/build/es/src/stores-v1-subscription-option.context.d.ts +0 -14
  201. package/build/es/src/stores-v1-subscription-option.context.js +0 -194
  202. package/build/es/src/stores-v1-subscription-option.context.js.map +0 -1
  203. package/build/es/src/stores-v1-subscription-option.http.d.ts +0 -128
  204. package/build/es/src/stores-v1-subscription-option.http.js +0 -451
  205. package/build/es/src/stores-v1-subscription-option.http.js.map +0 -1
  206. package/build/es/src/stores-v1-subscription-option.meta.d.ts +0 -40
  207. package/build/es/src/stores-v1-subscription-option.meta.js +0 -220
  208. package/build/es/src/stores-v1-subscription-option.meta.js.map +0 -1
  209. package/build/es/src/stores-v1-subscription-option.public.d.ts +0 -46
  210. package/build/es/src/stores-v1-subscription-option.public.js +0 -64
  211. package/build/es/src/stores-v1-subscription-option.public.js.map +0 -1
  212. package/build/es/src/stores-v1-subscription-option.types.d.ts +0 -351
  213. package/build/es/src/stores-v1-subscription-option.types.js +0 -17
  214. package/build/es/src/stores-v1-subscription-option.types.js.map +0 -1
  215. package/build/es/src/stores-v1-subscription-option.universal.d.ts +0 -646
  216. package/build/es/src/stores-v1-subscription-option.universal.js +0 -855
  217. package/build/es/src/stores-v1-subscription-option.universal.js.map +0 -1
  218. package/build/es/src/stores-v2-inventory.context.d.ts +0 -7
  219. package/build/es/src/stores-v2-inventory.context.js +0 -82
  220. package/build/es/src/stores-v2-inventory.context.js.map +0 -1
  221. package/build/es/src/stores-v2-inventory.http.d.ts +0 -31
  222. package/build/es/src/stores-v2-inventory.http.js +0 -281
  223. package/build/es/src/stores-v2-inventory.http.js.map +0 -1
  224. package/build/es/src/stores-v2-inventory.meta.d.ts +0 -21
  225. package/build/es/src/stores-v2-inventory.meta.js +0 -94
  226. package/build/es/src/stores-v2-inventory.meta.js.map +0 -1
  227. package/build/es/src/stores-v2-inventory.public.d.ts +0 -13
  228. package/build/es/src/stores-v2-inventory.public.js +0 -30
  229. package/build/es/src/stores-v2-inventory.public.js.map +0 -1
  230. package/build/es/src/stores-v2-inventory.types.d.ts +0 -283
  231. package/build/es/src/stores-v2-inventory.types.js +0 -8
  232. package/build/es/src/stores-v2-inventory.types.js.map +0 -1
  233. package/build/es/src/stores-v2-inventory.universal.d.ts +0 -425
  234. package/build/es/src/stores-v2-inventory.universal.js +0 -351
  235. package/build/es/src/stores-v2-inventory.universal.js.map +0 -1
@@ -1,2220 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.getStoreVariant = exports.queryStoreVariants = exports.queryProductVariants = exports.getProductOptionsAvailability = exports.getCollectionBySlug = exports.getProductPlatformized = exports.getProduct = exports.queryProducts = exports.writeProxyDeleteProductPlatformized = exports.writeProxyUpdateProductPlatformized = exports.writeProxyCreateProductPlatformized = exports.bulkAdjustProductProperty = exports.bulkUpdateProductsProperty = exports.removeRibbon = exports.deleteCollection = exports.updateCollection = exports.createCollection = exports.removeBrand = exports.deleteProductOptions = exports.removeProductMediaFromChoices = exports.addProductMediaToChoices = exports.removeProductMedia = exports.addProductMedia = exports.removeProductsFromCollection = exports.addProductsToCollection = exports.resetAllProductVariantData = exports.updateProductVariants = exports.deleteProductPlatformized = exports.deleteProduct = exports.updateProductPlatformized = exports.updateProduct = exports.createProductPlatformized = exports.createProduct = exports.onProductVariantsChanged = exports.onProductCollectionDeleted = exports.onProductCollectionChanged = exports.onProductCollectionCreated = exports.onProductDeleted = exports.onProductChanged = exports.onProductCreated = exports.SortOrder = exports.FileType = exports.DiscountType = exports.OptionType = exports.MediaItemType = exports.MeasurementUnit = exports.InventoryStatus = exports.ProductType = void 0;
36
- const velo_1 = require("@wix/metro-runtime/velo");
37
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
38
- const sdk_types_1 = require("@wix/sdk-types");
39
- const ambassadorWixStoresCatalogV1Product = __importStar(require("./stores-catalog-v1-product.http"));
40
- // @ts-ignore
41
- const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
42
- const _toVeloEntity = '$';
43
- const _fromVeloEntity = '$';
44
- var ProductType;
45
- (function (ProductType) {
46
- ProductType["unspecified_product_type"] = "unspecified_product_type";
47
- ProductType["physical"] = "physical";
48
- ProductType["digital"] = "digital";
49
- })(ProductType || (exports.ProductType = ProductType = {}));
50
- var InventoryStatus;
51
- (function (InventoryStatus) {
52
- InventoryStatus["IN_STOCK"] = "IN_STOCK";
53
- InventoryStatus["OUT_OF_STOCK"] = "OUT_OF_STOCK";
54
- InventoryStatus["PARTIALLY_OUT_OF_STOCK"] = "PARTIALLY_OUT_OF_STOCK";
55
- })(InventoryStatus || (exports.InventoryStatus = InventoryStatus = {}));
56
- var MeasurementUnit;
57
- (function (MeasurementUnit) {
58
- MeasurementUnit["UNSPECIFIED"] = "UNSPECIFIED";
59
- MeasurementUnit["ML"] = "ML";
60
- MeasurementUnit["CL"] = "CL";
61
- MeasurementUnit["L"] = "L";
62
- MeasurementUnit["CBM"] = "CBM";
63
- MeasurementUnit["MG"] = "MG";
64
- MeasurementUnit["G"] = "G";
65
- MeasurementUnit["KG"] = "KG";
66
- MeasurementUnit["MM"] = "MM";
67
- MeasurementUnit["CM"] = "CM";
68
- MeasurementUnit["M"] = "M";
69
- MeasurementUnit["SQM"] = "SQM";
70
- MeasurementUnit["OZ"] = "OZ";
71
- MeasurementUnit["LB"] = "LB";
72
- MeasurementUnit["FLOZ"] = "FLOZ";
73
- MeasurementUnit["PT"] = "PT";
74
- MeasurementUnit["QT"] = "QT";
75
- MeasurementUnit["GAL"] = "GAL";
76
- MeasurementUnit["IN"] = "IN";
77
- MeasurementUnit["FT"] = "FT";
78
- MeasurementUnit["YD"] = "YD";
79
- MeasurementUnit["SQFT"] = "SQFT";
80
- })(MeasurementUnit || (exports.MeasurementUnit = MeasurementUnit = {}));
81
- var MediaItemType;
82
- (function (MediaItemType) {
83
- MediaItemType["unspecified_media_item_type"] = "unspecified_media_item_type";
84
- MediaItemType["image"] = "image";
85
- MediaItemType["video"] = "video";
86
- MediaItemType["audio"] = "audio";
87
- MediaItemType["document"] = "document";
88
- MediaItemType["zip"] = "zip";
89
- })(MediaItemType || (exports.MediaItemType = MediaItemType = {}));
90
- var OptionType;
91
- (function (OptionType) {
92
- OptionType["unspecified_option_type"] = "unspecified_option_type";
93
- OptionType["drop_down"] = "drop_down";
94
- OptionType["color"] = "color";
95
- })(OptionType || (exports.OptionType = OptionType = {}));
96
- var DiscountType;
97
- (function (DiscountType) {
98
- DiscountType["UNDEFINED"] = "UNDEFINED";
99
- /** No discount */
100
- DiscountType["NONE"] = "NONE";
101
- DiscountType["AMOUNT"] = "AMOUNT";
102
- DiscountType["PERCENT"] = "PERCENT";
103
- })(DiscountType || (exports.DiscountType = DiscountType = {}));
104
- var FileType;
105
- (function (FileType) {
106
- FileType["UNSPECIFIED"] = "UNSPECIFIED";
107
- FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
108
- FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
109
- FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
110
- FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
111
- FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
112
- })(FileType || (exports.FileType = FileType = {}));
113
- var SortOrder;
114
- (function (SortOrder) {
115
- SortOrder["ASC"] = "ASC";
116
- SortOrder["DESC"] = "DESC";
117
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
118
- const _addProductMediaRequest = {};
119
- const _addProductMediaResponse = {};
120
- const _addProductMediaToChoicesRequest = {};
121
- const _addProductMediaToChoicesResponse = {};
122
- const _addProductsToCollectionRequest = {};
123
- const _addProductsToCollectionResponse = {};
124
- const _bulkAdjustProductPropertiesRequest = {};
125
- const _bulkAdjustProductPropertiesResponse = {};
126
- const _bulkUpdateProductsRequest = {};
127
- const _bulkUpdateProductsResponse = {};
128
- const _createCollectionRequest = {};
129
- const _createCollectionResponse = {};
130
- const _createProductPlatformizedRequest = {};
131
- const _createProductPlatformizedResponse = {};
132
- const _createProductRequest = {};
133
- const _createProductResponse = {};
134
- const _deleteCollectionRequest = {};
135
- const _deleteCollectionResponse = {};
136
- const _deleteProductOptionsRequest = {};
137
- const _deleteProductOptionsResponse = {};
138
- const _deleteProductPlatformizedRequest = {};
139
- const _deleteProductPlatformizedResponse = {};
140
- const _deleteProductRequest = {};
141
- const _deleteProductResponse = {};
142
- const _getCollectionBySlugRequest = {};
143
- const _getCollectionBySlugResponse = {};
144
- const _getProductPlatformizedRequest = {};
145
- const _getProductPlatformizedResponse = {};
146
- const _getProductRequest = {};
147
- const _getProductResponse = {};
148
- const _getStoreVariantRequest = {};
149
- const _getStoreVariantResponse = { variant: '_storeVariant' };
150
- const _platformMedia = {
151
- image: 'wix.common.Image',
152
- video: 'wix.common.VideoV2',
153
- };
154
- const _productOptionsAvailabilityRequest = {};
155
- const _productOptionsAvailabilityResponse = {};
156
- const _queryProductsPlatformizedRequest = {};
157
- const _queryProductsPlatformizedResponse = {};
158
- const _queryProductVariantsRequest = {};
159
- const _queryProductVariantsResponse = {};
160
- const _queryStoreVariantsRequest = {};
161
- const _queryStoreVariantsResponse = { variants: '_storeVariant' };
162
- const _removeProductBrandRequest = {};
163
- const _removeProductBrandResponse = {};
164
- const _removeProductMediaFromChoicesRequest = {};
165
- const _removeProductMediaFromChoicesResponse = {};
166
- const _removeProductMediaRequest = {};
167
- const _removeProductMediaResponse = {};
168
- const _removeProductRibbonRequest = {};
169
- const _removeProductRibbonResponse = {};
170
- const _removeProductsFromCollectionRequest = {};
171
- const _removeProductsFromCollectionResponse = {};
172
- const _resetAllVariantDataRequest = {};
173
- const _resetAllVariantDataResponse = {};
174
- const _storeVariant = { media: '_platformMedia' };
175
- const _updateCollectionRequest = {};
176
- const _updateCollectionResponse = {};
177
- const _updateProductPlatformizedRequest = {};
178
- const _updateProductPlatformizedResponse = {};
179
- const _updateProductRequest = {};
180
- const _updateProductResponse = {};
181
- const _updateVariantsRequest = {};
182
- const _updateVariantsResponse = {};
183
- const _v1CreateProductPlatformizedRequest = {};
184
- const _v1CreateProductPlatformizedResponse = {};
185
- const _v1DeleteProductPlatformizedRequest = {};
186
- const _v1DeleteProductPlatformizedResponse = {};
187
- const _v1UpdateProductPlatformizedRequest = {};
188
- const _v1UpdateProductPlatformizedResponse = {};
189
- const _collectionChanged = {};
190
- const _collectionCreated = {};
191
- const _collectionDeleted = {};
192
- const _costAndProfitData = {
193
- itemCost: 'google.protobuf.DoubleValue',
194
- profit: 'DOUBLE',
195
- profitMargin: 'DOUBLE',
196
- };
197
- const _priceData = {
198
- price: 'google.protobuf.DoubleValue',
199
- discountedPrice: 'DOUBLE',
200
- pricePerUnit: 'google.protobuf.DoubleValue',
201
- };
202
- const _productChanged = {};
203
- const _productCreated = {
204
- price: '_priceData',
205
- costAndProfitData: '_costAndProfitData',
206
- };
207
- const _productDeleted = {};
208
- const _variantsChanged = {};
209
- exports.onProductCreated = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.catalog.api.v1.ProductCreated', false, {
210
- rootSchema: _productCreated,
211
- depSchemas: { _costAndProfitData, _priceData },
212
- })();
213
- exports.onProductChanged = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.catalog.api.v1.ProductChanged', false, {
214
- rootSchema: _productChanged,
215
- depSchemas: {},
216
- })();
217
- exports.onProductDeleted = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.catalog.api.v1.ProductDeleted', false, {
218
- rootSchema: _productDeleted,
219
- depSchemas: {},
220
- })();
221
- exports.onProductCollectionCreated = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.catalog.api.v1.CollectionCreated', false, {
222
- rootSchema: _collectionCreated,
223
- depSchemas: {},
224
- })();
225
- exports.onProductCollectionChanged = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.catalog.api.v1.CollectionChanged', false, {
226
- rootSchema: _collectionChanged,
227
- depSchemas: {},
228
- })();
229
- exports.onProductCollectionDeleted = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.catalog.api.v1.CollectionDeleted', false, {
230
- rootSchema: _collectionDeleted,
231
- depSchemas: {},
232
- })();
233
- exports.onProductVariantsChanged = (0, sdk_types_1.EventDefinition)('com.wix.ecommerce.catalog.api.v1.VariantsChanged', false, {
234
- rootSchema: _variantsChanged,
235
- depSchemas: {},
236
- })();
237
- /**
238
- * Creates a new product.
239
- * @param product - Product information.
240
- * @public
241
- * @requiredField product
242
- * @requiredField product.costAndProfitData.itemCost
243
- * @requiredField product.name
244
- * @requiredField product.priceData
245
- * @requiredField product.priceData.price
246
- * @permissionScope Manage Stores - all permissions
247
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
248
- * @permissionScope Manage Products
249
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
250
- * @applicableIdentity APP
251
- */
252
- function createProduct(product) {
253
- var _a, _b, _c;
254
- return __awaiter(this, arguments, void 0, function* () {
255
- const requestTransformation = { product: '$[0]' };
256
- const responseTransformation = '$';
257
- // @ts-ignore
258
- const { httpClient, sideEffects } = arguments[1];
259
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
260
- rootSchema: _createProductRequest,
261
- depSchemas: {},
262
- fqdnTransformation: {
263
- paths: [...['product']],
264
- transformation: _fromVeloEntity,
265
- },
266
- customTransformation: requestTransformation,
267
- });
268
- const { fromJSON } = (0, velo_1.serializer)({
269
- rootSchema: _createProductResponse,
270
- depSchemas: {},
271
- fqdnTransformation: {
272
- paths: [...['product']],
273
- transformation: _toVeloEntity,
274
- },
275
- customTransformation: responseTransformation,
276
- });
277
- const payload = toAmbassadorRequest([product]);
278
- const reqOpts = ambassadorWixStoresCatalogV1Product.createProduct(payload);
279
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
280
- try {
281
- const result = yield httpClient.request(reqOpts);
282
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
283
- return fromJSON(result.data);
284
- }
285
- catch (err) {
286
- const transformedError = (0, transform_error_1.transformError)(err, {
287
- spreadPathsToArguments: {},
288
- explicitPathsToArguments: { product: '$[0]' },
289
- singleArgumentUnchanged: false,
290
- }, ['product']);
291
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
292
- throw transformedError;
293
- }
294
- });
295
- }
296
- exports.createProduct = createProduct;
297
- /**
298
- * Creates a new product.
299
- * @param product - Product information.
300
- * @public
301
- * @documentationMaturity preview
302
- * @requiredField product
303
- * @requiredField product.costAndProfitData.itemCost
304
- * @requiredField product.name
305
- * @requiredField product.priceData
306
- * @requiredField product.priceData.price
307
- * @permissionScope Manage Stores - all permissions
308
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
309
- * @permissionScope Manage Products
310
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
311
- * @applicableIdentity APP
312
- */
313
- function createProductPlatformized(product) {
314
- var _a, _b, _c;
315
- return __awaiter(this, arguments, void 0, function* () {
316
- const requestTransformation = { product: '$[0]' };
317
- const responseTransformation = '$.product';
318
- // @ts-ignore
319
- const { httpClient, sideEffects } = arguments[1];
320
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
321
- rootSchema: _createProductPlatformizedRequest,
322
- depSchemas: {},
323
- fqdnTransformation: {
324
- paths: [...['product']],
325
- transformation: _fromVeloEntity,
326
- },
327
- customTransformation: requestTransformation,
328
- });
329
- const { fromJSON } = (0, velo_1.serializer)({
330
- rootSchema: _createProductPlatformizedResponse,
331
- depSchemas: {},
332
- fqdnTransformation: {
333
- paths: [...['product']],
334
- transformation: _toVeloEntity,
335
- },
336
- customTransformation: responseTransformation,
337
- });
338
- const payload = toAmbassadorRequest([product]);
339
- const reqOpts = ambassadorWixStoresCatalogV1Product.createProductPlatformized(payload);
340
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
341
- try {
342
- const result = yield httpClient.request(reqOpts);
343
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
344
- return fromJSON(result.data);
345
- }
346
- catch (err) {
347
- const transformedError = (0, transform_error_1.transformError)(err, {
348
- spreadPathsToArguments: {},
349
- explicitPathsToArguments: { product: '$[0]' },
350
- singleArgumentUnchanged: false,
351
- }, ['product']);
352
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
353
- throw transformedError;
354
- }
355
- });
356
- }
357
- exports.createProductPlatformized = createProductPlatformized;
358
- /**
359
- * Updates specified fields in a product.
360
- * @param _id - Product ID (generated automatically by the catalog).
361
- * @public
362
- * @requiredField _id
363
- * @requiredField product
364
- * @param product - Product info to update.
365
- * @permissionScope Manage Stores - all permissions
366
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
367
- * @permissionScope Manage Products
368
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
369
- * @applicableIdentity APP
370
- */
371
- function updateProduct(_id, product) {
372
- var _a, _b, _c;
373
- return __awaiter(this, arguments, void 0, function* () {
374
- const requestTransformation = { product: { '*': '$[1]', id: '$[0]' } };
375
- const responseTransformation = '$';
376
- // @ts-ignore
377
- const { httpClient, sideEffects } = arguments[2];
378
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
379
- rootSchema: _updateProductRequest,
380
- depSchemas: {},
381
- fqdnTransformation: {
382
- paths: [...['product']],
383
- transformation: _fromVeloEntity,
384
- },
385
- customTransformation: requestTransformation,
386
- });
387
- const { fromJSON } = (0, velo_1.serializer)({
388
- rootSchema: _updateProductResponse,
389
- depSchemas: {},
390
- fqdnTransformation: {
391
- paths: [...['product']],
392
- transformation: _toVeloEntity,
393
- },
394
- customTransformation: responseTransformation,
395
- });
396
- const payload = toAmbassadorRequest([_id, product]);
397
- const reqOpts = ambassadorWixStoresCatalogV1Product.updateProduct(payload);
398
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
399
- try {
400
- const result = yield httpClient.request(reqOpts);
401
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
402
- return fromJSON(result.data);
403
- }
404
- catch (err) {
405
- const transformedError = (0, transform_error_1.transformError)(err, {
406
- spreadPathsToArguments: { product: '$[1]' },
407
- explicitPathsToArguments: { 'product.id': '$[0]' },
408
- singleArgumentUnchanged: false,
409
- }, ['_id', 'product']);
410
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
411
- throw transformedError;
412
- }
413
- });
414
- }
415
- exports.updateProduct = updateProduct;
416
- /**
417
- * Updates specified fields in a product.
418
- * @param _id - Product ID (generated automatically by the catalog).
419
- * @public
420
- * @documentationMaturity preview
421
- * @requiredField _id
422
- * @requiredField product
423
- * @permissionScope Manage Stores - all permissions
424
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
425
- * @permissionScope Manage Products
426
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
427
- * @applicableIdentity APP
428
- */
429
- function updateProductPlatformized(_id, product) {
430
- var _a, _b, _c;
431
- return __awaiter(this, arguments, void 0, function* () {
432
- const requestTransformation = { product: { '*': '$[1]', id: '$[0]' } };
433
- const responseTransformation = '$.product';
434
- // @ts-ignore
435
- const { httpClient, sideEffects } = arguments[2];
436
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
437
- rootSchema: _updateProductPlatformizedRequest,
438
- depSchemas: {},
439
- fqdnTransformation: {
440
- paths: [...['product']],
441
- transformation: _fromVeloEntity,
442
- },
443
- customTransformation: requestTransformation,
444
- });
445
- const { fromJSON } = (0, velo_1.serializer)({
446
- rootSchema: _updateProductPlatformizedResponse,
447
- depSchemas: {},
448
- fqdnTransformation: {
449
- paths: [...['product']],
450
- transformation: _toVeloEntity,
451
- },
452
- customTransformation: responseTransformation,
453
- });
454
- const payload = toAmbassadorRequest([_id, product]);
455
- const reqOpts = ambassadorWixStoresCatalogV1Product.updateProductPlatformized(payload);
456
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
457
- try {
458
- const result = yield httpClient.request(reqOpts);
459
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
460
- return fromJSON(result.data);
461
- }
462
- catch (err) {
463
- const transformedError = (0, transform_error_1.transformError)(err, {
464
- spreadPathsToArguments: { product: '$[1]' },
465
- explicitPathsToArguments: { 'product.id': '$[0]' },
466
- singleArgumentUnchanged: false,
467
- }, ['_id', 'product']);
468
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
469
- throw transformedError;
470
- }
471
- });
472
- }
473
- exports.updateProductPlatformized = updateProductPlatformized;
474
- /**
475
- * Deletes a product.
476
- * @param _id - ID of the product to delete.
477
- * @public
478
- * @requiredField _id
479
- * @permissionScope Manage Stores - all permissions
480
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
481
- * @permissionScope Manage Products
482
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
483
- * @applicableIdentity APP
484
- */
485
- function deleteProduct(_id) {
486
- var _a, _b, _c;
487
- return __awaiter(this, arguments, void 0, function* () {
488
- const requestTransformation = { id: '$[0]' };
489
- const responseTransformation = '$';
490
- // @ts-ignore
491
- const { httpClient, sideEffects } = arguments[1];
492
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
493
- rootSchema: _deleteProductRequest,
494
- depSchemas: {},
495
- fqdnTransformation: {
496
- paths: [],
497
- transformation: _fromVeloEntity,
498
- },
499
- customTransformation: requestTransformation,
500
- });
501
- const { fromJSON } = (0, velo_1.serializer)({
502
- rootSchema: _deleteProductResponse,
503
- depSchemas: {},
504
- fqdnTransformation: {
505
- paths: [],
506
- transformation: _toVeloEntity,
507
- },
508
- customTransformation: responseTransformation,
509
- });
510
- const payload = toAmbassadorRequest([_id]);
511
- const reqOpts = ambassadorWixStoresCatalogV1Product.deleteProduct(payload);
512
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
513
- try {
514
- const result = yield httpClient.request(reqOpts);
515
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
516
- }
517
- catch (err) {
518
- const transformedError = (0, transform_error_1.transformError)(err, {
519
- spreadPathsToArguments: {},
520
- explicitPathsToArguments: { id: '$[0]' },
521
- singleArgumentUnchanged: false,
522
- }, ['_id']);
523
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
524
- throw transformedError;
525
- }
526
- });
527
- }
528
- exports.deleteProduct = deleteProduct;
529
- /**
530
- * Deletes a product.
531
- * @param _id - ID of the product to delete.
532
- * @public
533
- * @documentationMaturity preview
534
- * @requiredField _id
535
- * @permissionScope Manage Stores - all permissions
536
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
537
- * @permissionScope Manage Products
538
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
539
- * @applicableIdentity APP
540
- */
541
- function deleteProductPlatformized(_id) {
542
- var _a, _b, _c;
543
- return __awaiter(this, arguments, void 0, function* () {
544
- const requestTransformation = { id: '$[0]' };
545
- const responseTransformation = '$';
546
- // @ts-ignore
547
- const { httpClient, sideEffects } = arguments[1];
548
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
549
- rootSchema: _deleteProductPlatformizedRequest,
550
- depSchemas: {},
551
- fqdnTransformation: {
552
- paths: [],
553
- transformation: _fromVeloEntity,
554
- },
555
- customTransformation: requestTransformation,
556
- });
557
- const { fromJSON } = (0, velo_1.serializer)({
558
- rootSchema: _deleteProductPlatformizedResponse,
559
- depSchemas: {},
560
- fqdnTransformation: {
561
- paths: [],
562
- transformation: _toVeloEntity,
563
- },
564
- customTransformation: responseTransformation,
565
- });
566
- const payload = toAmbassadorRequest([_id]);
567
- const reqOpts = ambassadorWixStoresCatalogV1Product.deleteProductPlatformized(payload);
568
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
569
- try {
570
- const result = yield httpClient.request(reqOpts);
571
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
572
- }
573
- catch (err) {
574
- const transformedError = (0, transform_error_1.transformError)(err, {
575
- spreadPathsToArguments: {},
576
- explicitPathsToArguments: { id: '$[0]' },
577
- singleArgumentUnchanged: false,
578
- }, ['_id']);
579
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
580
- throw transformedError;
581
- }
582
- });
583
- }
584
- exports.deleteProductPlatformized = deleteProductPlatformized;
585
- /**
586
- * Updates variants of a specified product.
587
- * @param _id - ID of the product with managed variants.
588
- * @param variants - Variant info to update.
589
- * @public
590
- * @documentationMaturity preview
591
- * @requiredField _id
592
- * @requiredField variants
593
- * @permissionScope Manage Stores - all permissions
594
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
595
- * @permissionScope Manage Products
596
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
597
- * @applicableIdentity APP
598
- */
599
- function updateProductVariants(_id, variants) {
600
- var _a, _b, _c;
601
- return __awaiter(this, arguments, void 0, function* () {
602
- const requestTransformation = { id: '$[0]', variants: '$[1]' };
603
- const responseTransformation = '$';
604
- // @ts-ignore
605
- const { httpClient, sideEffects } = arguments[2];
606
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
607
- rootSchema: _updateVariantsRequest,
608
- depSchemas: {},
609
- fqdnTransformation: {
610
- paths: [],
611
- transformation: _fromVeloEntity,
612
- },
613
- customTransformation: requestTransformation,
614
- });
615
- const { fromJSON } = (0, velo_1.serializer)({
616
- rootSchema: _updateVariantsResponse,
617
- depSchemas: {},
618
- fqdnTransformation: {
619
- paths: [],
620
- transformation: _toVeloEntity,
621
- },
622
- customTransformation: responseTransformation,
623
- });
624
- const payload = toAmbassadorRequest([_id, variants]);
625
- const reqOpts = ambassadorWixStoresCatalogV1Product.updateVariants(payload);
626
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
627
- try {
628
- const result = yield httpClient.request(reqOpts);
629
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
630
- return fromJSON(result.data);
631
- }
632
- catch (err) {
633
- const transformedError = (0, transform_error_1.transformError)(err, {
634
- spreadPathsToArguments: {},
635
- explicitPathsToArguments: { id: '$[0]', variants: '$[1]' },
636
- singleArgumentUnchanged: false,
637
- }, ['_id', 'variants']);
638
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
639
- throw transformedError;
640
- }
641
- });
642
- }
643
- exports.updateProductVariants = updateProductVariants;
644
- /**
645
- * Resets the data (such as the price and the weight) of all variants for a given product to their default values.
646
- * @param _id - Product ID.
647
- * @public
648
- * @documentationMaturity preview
649
- * @requiredField _id
650
- * @permissionScope Manage Stores - all permissions
651
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
652
- * @permissionScope Manage Products
653
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
654
- * @applicableIdentity APP
655
- */
656
- function resetAllProductVariantData(_id) {
657
- var _a, _b, _c;
658
- return __awaiter(this, arguments, void 0, function* () {
659
- const requestTransformation = { id: '$[0]' };
660
- const responseTransformation = '$';
661
- // @ts-ignore
662
- const { httpClient, sideEffects } = arguments[1];
663
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
664
- rootSchema: _resetAllVariantDataRequest,
665
- depSchemas: {},
666
- fqdnTransformation: {
667
- paths: [],
668
- transformation: _fromVeloEntity,
669
- },
670
- customTransformation: requestTransformation,
671
- });
672
- const { fromJSON } = (0, velo_1.serializer)({
673
- rootSchema: _resetAllVariantDataResponse,
674
- depSchemas: {},
675
- fqdnTransformation: {
676
- paths: [],
677
- transformation: _toVeloEntity,
678
- },
679
- customTransformation: responseTransformation,
680
- });
681
- const payload = toAmbassadorRequest([_id]);
682
- const reqOpts = ambassadorWixStoresCatalogV1Product.resetAllVariantData(payload);
683
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
684
- try {
685
- const result = yield httpClient.request(reqOpts);
686
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
687
- }
688
- catch (err) {
689
- const transformedError = (0, transform_error_1.transformError)(err, {
690
- spreadPathsToArguments: {},
691
- explicitPathsToArguments: { id: '$[0]' },
692
- singleArgumentUnchanged: false,
693
- }, ['_id']);
694
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
695
- throw transformedError;
696
- }
697
- });
698
- }
699
- exports.resetAllProductVariantData = resetAllProductVariantData;
700
- /**
701
- * Adds products to a specified collection.
702
- * @param _id - Collection ID.
703
- * @param productIds - IDs of the products to add to the collection, separated by commas.
704
- * @public
705
- * @requiredField _id
706
- * @requiredField productIds
707
- * @permissionScope Manage Stores - all permissions
708
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
709
- * @permissionScope Manage Products
710
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
711
- * @applicableIdentity APP
712
- */
713
- function addProductsToCollection(_id, productIds) {
714
- var _a, _b, _c;
715
- return __awaiter(this, arguments, void 0, function* () {
716
- const requestTransformation = { id: '$[0]', productIds: '$[1]' };
717
- const responseTransformation = '$';
718
- // @ts-ignore
719
- const { httpClient, sideEffects } = arguments[2];
720
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
721
- rootSchema: _addProductsToCollectionRequest,
722
- depSchemas: {},
723
- fqdnTransformation: {
724
- paths: [],
725
- transformation: _fromVeloEntity,
726
- },
727
- customTransformation: requestTransformation,
728
- });
729
- const { fromJSON } = (0, velo_1.serializer)({
730
- rootSchema: _addProductsToCollectionResponse,
731
- depSchemas: {},
732
- fqdnTransformation: {
733
- paths: [],
734
- transformation: _toVeloEntity,
735
- },
736
- customTransformation: responseTransformation,
737
- });
738
- const payload = toAmbassadorRequest([_id, productIds]);
739
- const reqOpts = ambassadorWixStoresCatalogV1Product.addProductsToCollection(payload);
740
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
741
- try {
742
- const result = yield httpClient.request(reqOpts);
743
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
744
- }
745
- catch (err) {
746
- const transformedError = (0, transform_error_1.transformError)(err, {
747
- spreadPathsToArguments: {},
748
- explicitPathsToArguments: { id: '$[0]', productIds: '$[1]' },
749
- singleArgumentUnchanged: false,
750
- }, ['_id', 'productIds']);
751
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
752
- throw transformedError;
753
- }
754
- });
755
- }
756
- exports.addProductsToCollection = addProductsToCollection;
757
- /**
758
- * Deletes products from a specified collection.
759
- * @param _id - ID of the collection from which to remove products.
760
- * @param productIds - IDs of the products to remove from the collection.
761
- * @public
762
- * @requiredField _id
763
- * @requiredField productIds
764
- * @permissionScope Manage Stores - all permissions
765
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
766
- * @permissionScope Manage Products
767
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
768
- * @applicableIdentity APP
769
- */
770
- function removeProductsFromCollection(_id, productIds) {
771
- var _a, _b, _c;
772
- return __awaiter(this, arguments, void 0, function* () {
773
- const requestTransformation = { id: '$[0]', productIds: '$[1]' };
774
- const responseTransformation = '$';
775
- // @ts-ignore
776
- const { httpClient, sideEffects } = arguments[2];
777
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
778
- rootSchema: _removeProductsFromCollectionRequest,
779
- depSchemas: {},
780
- fqdnTransformation: {
781
- paths: [],
782
- transformation: _fromVeloEntity,
783
- },
784
- customTransformation: requestTransformation,
785
- });
786
- const { fromJSON } = (0, velo_1.serializer)({
787
- rootSchema: _removeProductsFromCollectionResponse,
788
- depSchemas: {},
789
- fqdnTransformation: {
790
- paths: [],
791
- transformation: _toVeloEntity,
792
- },
793
- customTransformation: responseTransformation,
794
- });
795
- const payload = toAmbassadorRequest([_id, productIds]);
796
- const reqOpts = ambassadorWixStoresCatalogV1Product.removeProductsFromCollection(payload);
797
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
798
- try {
799
- const result = yield httpClient.request(reqOpts);
800
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
801
- }
802
- catch (err) {
803
- const transformedError = (0, transform_error_1.transformError)(err, {
804
- spreadPathsToArguments: {},
805
- explicitPathsToArguments: { id: '$[0]', productIds: '$[1]' },
806
- singleArgumentUnchanged: false,
807
- }, ['_id', 'productIds']);
808
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
809
- throw transformedError;
810
- }
811
- });
812
- }
813
- exports.removeProductsFromCollection = removeProductsFromCollection;
814
- /**
815
- * Adds media items to a specified product, either via URL or existing media ID.
816
- *
817
- * > **NOTE:** The URL is not validated and no event is triggered to indicate if the media was added successfully.
818
- * @param _id - Product ID.
819
- * @param media - Sources of media items already uploaded to the Wix site.
820
- * @public
821
- * @requiredField _id
822
- * @requiredField media
823
- * @permissionScope Manage Stores - all permissions
824
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
825
- * @permissionScope Manage Products
826
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
827
- * @applicableIdentity APP
828
- */
829
- function addProductMedia(_id, media) {
830
- var _a, _b, _c;
831
- return __awaiter(this, arguments, void 0, function* () {
832
- const requestTransformation = { id: '$[0]', media: '$[1]' };
833
- const responseTransformation = '$';
834
- // @ts-ignore
835
- const { httpClient, sideEffects } = arguments[2];
836
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
837
- rootSchema: _addProductMediaRequest,
838
- depSchemas: {},
839
- fqdnTransformation: {
840
- paths: [],
841
- transformation: _fromVeloEntity,
842
- },
843
- customTransformation: requestTransformation,
844
- });
845
- const { fromJSON } = (0, velo_1.serializer)({
846
- rootSchema: _addProductMediaResponse,
847
- depSchemas: {},
848
- fqdnTransformation: {
849
- paths: [],
850
- transformation: _toVeloEntity,
851
- },
852
- customTransformation: responseTransformation,
853
- });
854
- const payload = toAmbassadorRequest([_id, media]);
855
- const reqOpts = ambassadorWixStoresCatalogV1Product.addProductMedia(payload);
856
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
857
- try {
858
- const result = yield httpClient.request(reqOpts);
859
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
860
- }
861
- catch (err) {
862
- const transformedError = (0, transform_error_1.transformError)(err, {
863
- spreadPathsToArguments: {},
864
- explicitPathsToArguments: { id: '$[0]', media: '$[1]' },
865
- singleArgumentUnchanged: false,
866
- }, ['_id', 'media']);
867
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
868
- throw transformedError;
869
- }
870
- });
871
- }
872
- exports.addProductMedia = addProductMedia;
873
- /**
874
- * Removes specified media items from a product.
875
- * Pass an empty array to remove all media items.
876
- * @param _id - Product ID.
877
- * @param mediaIds - List of media IDs to remove. Pass an empty array to delete all media items for the product.
878
- * @public
879
- * @requiredField _id
880
- * @requiredField mediaIds
881
- * @permissionScope Manage Stores - all permissions
882
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
883
- * @permissionScope Manage Products
884
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
885
- * @applicableIdentity APP
886
- */
887
- function removeProductMedia(_id, mediaIds) {
888
- var _a, _b, _c;
889
- return __awaiter(this, arguments, void 0, function* () {
890
- const requestTransformation = { id: '$[0]', mediaIds: '$[1]' };
891
- const responseTransformation = '$';
892
- // @ts-ignore
893
- const { httpClient, sideEffects } = arguments[2];
894
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
895
- rootSchema: _removeProductMediaRequest,
896
- depSchemas: {},
897
- fqdnTransformation: {
898
- paths: [],
899
- transformation: _fromVeloEntity,
900
- },
901
- customTransformation: requestTransformation,
902
- });
903
- const { fromJSON } = (0, velo_1.serializer)({
904
- rootSchema: _removeProductMediaResponse,
905
- depSchemas: {},
906
- fqdnTransformation: {
907
- paths: [],
908
- transformation: _toVeloEntity,
909
- },
910
- customTransformation: responseTransformation,
911
- });
912
- const payload = toAmbassadorRequest([_id, mediaIds]);
913
- const reqOpts = ambassadorWixStoresCatalogV1Product.removeProductMedia(payload);
914
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
915
- try {
916
- const result = yield httpClient.request(reqOpts);
917
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
918
- }
919
- catch (err) {
920
- const transformedError = (0, transform_error_1.transformError)(err, {
921
- spreadPathsToArguments: {},
922
- explicitPathsToArguments: { id: '$[0]', mediaIds: '$[1]' },
923
- singleArgumentUnchanged: false,
924
- }, ['_id', 'mediaIds']);
925
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
926
- throw transformedError;
927
- }
928
- });
929
- }
930
- exports.removeProductMedia = removeProductMedia;
931
- /**
932
- * Links media items that are already associated with a specific product to a choice within the same product.
933
- *
934
- * Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).
935
- *
936
- * To remove all existing media items, call the [Remove Product Media From Choices](https://dev.wix.com/api/rest/wix-stores/catalog/products/remove-product-media-from-choices) endpoint.
937
- * @param _id - Product ID.
938
- * @param media - Product media items and the choices to add the media to.
939
- * @public
940
- * @requiredField _id
941
- * @requiredField media
942
- * @requiredField media.choice
943
- * @requiredField media.option
944
- * @permissionScope Manage Stores - all permissions
945
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
946
- * @permissionScope Manage Products
947
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
948
- * @applicableIdentity APP
949
- */
950
- function addProductMediaToChoices(_id, media) {
951
- var _a, _b, _c;
952
- return __awaiter(this, arguments, void 0, function* () {
953
- const requestTransformation = { id: '$[0]', media: '$[1]' };
954
- const responseTransformation = '$';
955
- // @ts-ignore
956
- const { httpClient, sideEffects } = arguments[2];
957
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
958
- rootSchema: _addProductMediaToChoicesRequest,
959
- depSchemas: {},
960
- fqdnTransformation: {
961
- paths: [],
962
- transformation: _fromVeloEntity,
963
- },
964
- customTransformation: requestTransformation,
965
- });
966
- const { fromJSON } = (0, velo_1.serializer)({
967
- rootSchema: _addProductMediaToChoicesResponse,
968
- depSchemas: {},
969
- fqdnTransformation: {
970
- paths: [],
971
- transformation: _toVeloEntity,
972
- },
973
- customTransformation: responseTransformation,
974
- });
975
- const payload = toAmbassadorRequest([_id, media]);
976
- const reqOpts = ambassadorWixStoresCatalogV1Product.addProductMediaToChoices(payload);
977
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
978
- try {
979
- const result = yield httpClient.request(reqOpts);
980
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
981
- }
982
- catch (err) {
983
- const transformedError = (0, transform_error_1.transformError)(err, {
984
- spreadPathsToArguments: {},
985
- explicitPathsToArguments: { id: '$[0]', media: '$[1]' },
986
- singleArgumentUnchanged: false,
987
- }, ['_id', 'media']);
988
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
989
- throw transformedError;
990
- }
991
- });
992
- }
993
- exports.addProductMediaToChoices = addProductMediaToChoices;
994
- /**
995
- * Removes media items from all or some of a product's choices.
996
- * (Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).)
997
- * @param _id - Product ID from whose choices to remove media items.
998
- * @param media - Media to remove from choices. If an empty array is passed, all media will be removed from all choices for the given product.
999
- * @public
1000
- * @requiredField _id
1001
- * @requiredField media
1002
- * @permissionScope Manage Stores - all permissions
1003
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1004
- * @permissionScope Manage Products
1005
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1006
- * @applicableIdentity APP
1007
- */
1008
- function removeProductMediaFromChoices(_id, media) {
1009
- var _a, _b, _c;
1010
- return __awaiter(this, arguments, void 0, function* () {
1011
- const requestTransformation = { id: '$[0]', media: '$[1]' };
1012
- const responseTransformation = '$';
1013
- // @ts-ignore
1014
- const { httpClient, sideEffects } = arguments[2];
1015
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1016
- rootSchema: _removeProductMediaFromChoicesRequest,
1017
- depSchemas: {},
1018
- fqdnTransformation: {
1019
- paths: [],
1020
- transformation: _fromVeloEntity,
1021
- },
1022
- customTransformation: requestTransformation,
1023
- });
1024
- const { fromJSON } = (0, velo_1.serializer)({
1025
- rootSchema: _removeProductMediaFromChoicesResponse,
1026
- depSchemas: {},
1027
- fqdnTransformation: {
1028
- paths: [],
1029
- transformation: _toVeloEntity,
1030
- },
1031
- customTransformation: responseTransformation,
1032
- });
1033
- const payload = toAmbassadorRequest([_id, media]);
1034
- const reqOpts = ambassadorWixStoresCatalogV1Product.removeProductMediaFromChoices(payload);
1035
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1036
- try {
1037
- const result = yield httpClient.request(reqOpts);
1038
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1039
- }
1040
- catch (err) {
1041
- const transformedError = (0, transform_error_1.transformError)(err, {
1042
- spreadPathsToArguments: {},
1043
- explicitPathsToArguments: { id: '$[0]', media: '$[1]' },
1044
- singleArgumentUnchanged: false,
1045
- }, ['_id', 'media']);
1046
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1047
- throw transformedError;
1048
- }
1049
- });
1050
- }
1051
- exports.removeProductMediaFromChoices = removeProductMediaFromChoices;
1052
- /**
1053
- * Delete all options from a specific product. Only available when [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is disabled.
1054
- * @param _id - ID of the product with options to delete.
1055
- * @public
1056
- * @requiredField _id
1057
- * @permissionScope Manage Stores - all permissions
1058
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1059
- * @permissionScope Manage Products
1060
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1061
- * @applicableIdentity APP
1062
- */
1063
- function deleteProductOptions(_id) {
1064
- var _a, _b, _c;
1065
- return __awaiter(this, arguments, void 0, function* () {
1066
- const requestTransformation = { id: '$[0]' };
1067
- const responseTransformation = '$';
1068
- // @ts-ignore
1069
- const { httpClient, sideEffects } = arguments[1];
1070
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1071
- rootSchema: _deleteProductOptionsRequest,
1072
- depSchemas: {},
1073
- fqdnTransformation: {
1074
- paths: [],
1075
- transformation: _fromVeloEntity,
1076
- },
1077
- customTransformation: requestTransformation,
1078
- });
1079
- const { fromJSON } = (0, velo_1.serializer)({
1080
- rootSchema: _deleteProductOptionsResponse,
1081
- depSchemas: {},
1082
- fqdnTransformation: {
1083
- paths: [],
1084
- transformation: _toVeloEntity,
1085
- },
1086
- customTransformation: responseTransformation,
1087
- });
1088
- const payload = toAmbassadorRequest([_id]);
1089
- const reqOpts = ambassadorWixStoresCatalogV1Product.deleteProductOptions(payload);
1090
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1091
- try {
1092
- const result = yield httpClient.request(reqOpts);
1093
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1094
- }
1095
- catch (err) {
1096
- const transformedError = (0, transform_error_1.transformError)(err, {
1097
- spreadPathsToArguments: {},
1098
- explicitPathsToArguments: { id: '$[0]' },
1099
- singleArgumentUnchanged: false,
1100
- }, ['_id']);
1101
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1102
- throw transformedError;
1103
- }
1104
- });
1105
- }
1106
- exports.deleteProductOptions = deleteProductOptions;
1107
- /**
1108
- * Deletes a product's brand.
1109
- * @param _id - Product ID.
1110
- * @public
1111
- * @documentationMaturity preview
1112
- * @requiredField _id
1113
- * @permissionScope Manage Stores - all permissions
1114
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1115
- * @permissionScope Manage Products
1116
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1117
- * @applicableIdentity APP
1118
- */
1119
- function removeBrand(_id) {
1120
- var _a, _b, _c;
1121
- return __awaiter(this, arguments, void 0, function* () {
1122
- const requestTransformation = { id: '$[0]' };
1123
- const responseTransformation = '$';
1124
- // @ts-ignore
1125
- const { httpClient, sideEffects } = arguments[1];
1126
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1127
- rootSchema: _removeProductBrandRequest,
1128
- depSchemas: {},
1129
- fqdnTransformation: {
1130
- paths: [],
1131
- transformation: _fromVeloEntity,
1132
- },
1133
- customTransformation: requestTransformation,
1134
- });
1135
- const { fromJSON } = (0, velo_1.serializer)({
1136
- rootSchema: _removeProductBrandResponse,
1137
- depSchemas: {},
1138
- fqdnTransformation: {
1139
- paths: [],
1140
- transformation: _toVeloEntity,
1141
- },
1142
- customTransformation: responseTransformation,
1143
- });
1144
- const payload = toAmbassadorRequest([_id]);
1145
- const reqOpts = ambassadorWixStoresCatalogV1Product.removeBrand(payload);
1146
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1147
- try {
1148
- const result = yield httpClient.request(reqOpts);
1149
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1150
- }
1151
- catch (err) {
1152
- const transformedError = (0, transform_error_1.transformError)(err, {
1153
- spreadPathsToArguments: {},
1154
- explicitPathsToArguments: { id: '$[0]' },
1155
- singleArgumentUnchanged: false,
1156
- }, ['_id']);
1157
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1158
- throw transformedError;
1159
- }
1160
- });
1161
- }
1162
- exports.removeBrand = removeBrand;
1163
- /**
1164
- * Creates a new collection.
1165
- * @param collection - Collection info.
1166
- * @public
1167
- * @documentationMaturity preview
1168
- * @requiredField collection
1169
- * @requiredField collection.name
1170
- * @permissionScope Manage Stores - all permissions
1171
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1172
- * @permissionScope Manage Products
1173
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1174
- * @applicableIdentity APP
1175
- */
1176
- function createCollection(collection) {
1177
- var _a, _b, _c;
1178
- return __awaiter(this, arguments, void 0, function* () {
1179
- const requestTransformation = { collection: '$[0]' };
1180
- const responseTransformation = '$';
1181
- // @ts-ignore
1182
- const { httpClient, sideEffects } = arguments[1];
1183
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1184
- rootSchema: _createCollectionRequest,
1185
- depSchemas: {},
1186
- fqdnTransformation: {
1187
- paths: [],
1188
- transformation: _fromVeloEntity,
1189
- },
1190
- customTransformation: requestTransformation,
1191
- });
1192
- const { fromJSON } = (0, velo_1.serializer)({
1193
- rootSchema: _createCollectionResponse,
1194
- depSchemas: {},
1195
- fqdnTransformation: {
1196
- paths: [],
1197
- transformation: _toVeloEntity,
1198
- },
1199
- customTransformation: responseTransformation,
1200
- });
1201
- const payload = toAmbassadorRequest([collection]);
1202
- const reqOpts = ambassadorWixStoresCatalogV1Product.createCollection(payload);
1203
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1204
- try {
1205
- const result = yield httpClient.request(reqOpts);
1206
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1207
- return fromJSON(result.data);
1208
- }
1209
- catch (err) {
1210
- const transformedError = (0, transform_error_1.transformError)(err, {
1211
- spreadPathsToArguments: {},
1212
- explicitPathsToArguments: { collection: '$[0]' },
1213
- singleArgumentUnchanged: false,
1214
- }, ['collection']);
1215
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1216
- throw transformedError;
1217
- }
1218
- });
1219
- }
1220
- exports.createCollection = createCollection;
1221
- /**
1222
- * Updates specified properties of a collection. To add products to a collection, call the [addProductsToCollection](#addproductstocollection) function.
1223
- * @param _id - Collection ID (generated automatically by the catalog).
1224
- * @public
1225
- * @requiredField _id
1226
- * @requiredField collection
1227
- * @param collection - Collection info to update.
1228
- * @permissionScope Manage Stores - all permissions
1229
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1230
- * @permissionScope Manage Products
1231
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1232
- * @applicableIdentity APP
1233
- */
1234
- function updateCollection(_id, collection) {
1235
- var _a, _b, _c;
1236
- return __awaiter(this, arguments, void 0, function* () {
1237
- const requestTransformation = { collection: { '*': '$[1]', id: '$[0]' } };
1238
- const responseTransformation = '$';
1239
- // @ts-ignore
1240
- const { httpClient, sideEffects } = arguments[2];
1241
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1242
- rootSchema: _updateCollectionRequest,
1243
- depSchemas: {},
1244
- fqdnTransformation: {
1245
- paths: [],
1246
- transformation: _fromVeloEntity,
1247
- },
1248
- customTransformation: requestTransformation,
1249
- });
1250
- const { fromJSON } = (0, velo_1.serializer)({
1251
- rootSchema: _updateCollectionResponse,
1252
- depSchemas: {},
1253
- fqdnTransformation: {
1254
- paths: [],
1255
- transformation: _toVeloEntity,
1256
- },
1257
- customTransformation: responseTransformation,
1258
- });
1259
- const payload = toAmbassadorRequest([_id, collection]);
1260
- const reqOpts = ambassadorWixStoresCatalogV1Product.updateCollection(payload);
1261
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1262
- try {
1263
- const result = yield httpClient.request(reqOpts);
1264
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1265
- return fromJSON(result.data);
1266
- }
1267
- catch (err) {
1268
- const transformedError = (0, transform_error_1.transformError)(err, {
1269
- spreadPathsToArguments: { collection: '$[1]' },
1270
- explicitPathsToArguments: { 'collection.id': '$[0]' },
1271
- singleArgumentUnchanged: false,
1272
- }, ['_id', 'collection']);
1273
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1274
- throw transformedError;
1275
- }
1276
- });
1277
- }
1278
- exports.updateCollection = updateCollection;
1279
- /**
1280
- * Deletes a collection.
1281
- * @public
1282
- * @requiredField _id
1283
- * @param _id - ID of the collection to delete.
1284
- * @permissionScope Manage Stores - all permissions
1285
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1286
- * @permissionScope Manage Products
1287
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1288
- * @applicableIdentity APP
1289
- */
1290
- function deleteCollection(_id) {
1291
- var _a, _b, _c;
1292
- return __awaiter(this, arguments, void 0, function* () {
1293
- const requestTransformation = { id: '$[0]' };
1294
- const responseTransformation = '$';
1295
- // @ts-ignore
1296
- const { httpClient, sideEffects } = arguments[1];
1297
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1298
- rootSchema: _deleteCollectionRequest,
1299
- depSchemas: {},
1300
- fqdnTransformation: {
1301
- paths: [],
1302
- transformation: _fromVeloEntity,
1303
- },
1304
- customTransformation: requestTransformation,
1305
- });
1306
- const { fromJSON } = (0, velo_1.serializer)({
1307
- rootSchema: _deleteCollectionResponse,
1308
- depSchemas: {},
1309
- fqdnTransformation: {
1310
- paths: [],
1311
- transformation: _toVeloEntity,
1312
- },
1313
- customTransformation: responseTransformation,
1314
- });
1315
- const payload = toAmbassadorRequest([_id]);
1316
- const reqOpts = ambassadorWixStoresCatalogV1Product.deleteCollection(payload);
1317
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1318
- try {
1319
- const result = yield httpClient.request(reqOpts);
1320
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1321
- }
1322
- catch (err) {
1323
- const transformedError = (0, transform_error_1.transformError)(err, {
1324
- spreadPathsToArguments: {},
1325
- explicitPathsToArguments: { id: '$[0]' },
1326
- singleArgumentUnchanged: false,
1327
- }, ['_id']);
1328
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1329
- throw transformedError;
1330
- }
1331
- });
1332
- }
1333
- exports.deleteCollection = deleteCollection;
1334
- /**
1335
- * Deletes a product's ribbon.
1336
- * @param _id - Product ID.
1337
- * @public
1338
- * @documentationMaturity preview
1339
- * @requiredField _id
1340
- * @permissionScope Manage Stores - all permissions
1341
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1342
- * @permissionScope Manage Products
1343
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1344
- * @applicableIdentity APP
1345
- */
1346
- function removeRibbon(_id) {
1347
- var _a, _b, _c;
1348
- return __awaiter(this, arguments, void 0, function* () {
1349
- const requestTransformation = { id: '$[0]' };
1350
- const responseTransformation = '$';
1351
- // @ts-ignore
1352
- const { httpClient, sideEffects } = arguments[1];
1353
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1354
- rootSchema: _removeProductRibbonRequest,
1355
- depSchemas: {},
1356
- fqdnTransformation: {
1357
- paths: [],
1358
- transformation: _fromVeloEntity,
1359
- },
1360
- customTransformation: requestTransformation,
1361
- });
1362
- const { fromJSON } = (0, velo_1.serializer)({
1363
- rootSchema: _removeProductRibbonResponse,
1364
- depSchemas: {},
1365
- fqdnTransformation: {
1366
- paths: [],
1367
- transformation: _toVeloEntity,
1368
- },
1369
- customTransformation: responseTransformation,
1370
- });
1371
- const payload = toAmbassadorRequest([_id]);
1372
- const reqOpts = ambassadorWixStoresCatalogV1Product.removeRibbon(payload);
1373
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1374
- try {
1375
- const result = yield httpClient.request(reqOpts);
1376
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1377
- }
1378
- catch (err) {
1379
- const transformedError = (0, transform_error_1.transformError)(err, {
1380
- spreadPathsToArguments: {},
1381
- explicitPathsToArguments: { id: '$[0]' },
1382
- singleArgumentUnchanged: false,
1383
- }, ['_id']);
1384
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1385
- throw transformedError;
1386
- }
1387
- });
1388
- }
1389
- exports.removeRibbon = removeRibbon;
1390
- /**
1391
- * Updates a specified property for up to 100 products at a time.
1392
- * @param ids - Product IDs.
1393
- * @param set - Field to update.
1394
- * @public
1395
- * @documentationMaturity preview
1396
- * @requiredField ids
1397
- * @requiredField set
1398
- * @permissionScope Manage Stores - all permissions
1399
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1400
- * @permissionScope Manage Products
1401
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1402
- * @applicableIdentity APP
1403
- */
1404
- function bulkUpdateProductsProperty(ids, set) {
1405
- var _a, _b, _c;
1406
- return __awaiter(this, arguments, void 0, function* () {
1407
- const requestTransformation = { ids: '$[0]', set: '$[1]' };
1408
- const responseTransformation = '$';
1409
- // @ts-ignore
1410
- const { httpClient, sideEffects } = arguments[2];
1411
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1412
- rootSchema: _bulkUpdateProductsRequest,
1413
- depSchemas: {},
1414
- fqdnTransformation: {
1415
- paths: [],
1416
- transformation: _fromVeloEntity,
1417
- },
1418
- customTransformation: requestTransformation,
1419
- });
1420
- const { fromJSON } = (0, velo_1.serializer)({
1421
- rootSchema: _bulkUpdateProductsResponse,
1422
- depSchemas: {},
1423
- fqdnTransformation: {
1424
- paths: [],
1425
- transformation: _toVeloEntity,
1426
- },
1427
- customTransformation: responseTransformation,
1428
- });
1429
- const payload = toAmbassadorRequest([ids, set]);
1430
- const reqOpts = ambassadorWixStoresCatalogV1Product.bulkUpdateProducts(payload);
1431
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1432
- try {
1433
- const result = yield httpClient.request(reqOpts);
1434
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1435
- return fromJSON(result.data);
1436
- }
1437
- catch (err) {
1438
- const transformedError = (0, transform_error_1.transformError)(err, {
1439
- spreadPathsToArguments: {},
1440
- explicitPathsToArguments: { ids: '$[0]', set: '$[1]' },
1441
- singleArgumentUnchanged: false,
1442
- }, ['ids', 'set']);
1443
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1444
- throw transformedError;
1445
- }
1446
- });
1447
- }
1448
- exports.bulkUpdateProductsProperty = bulkUpdateProductsProperty;
1449
- /**
1450
- * Adjusts a specified numerical property for up to 100 products at a time.
1451
- * The property can be increased or decreased either by percentage or amount.
1452
- * @param adjust - Numerical property to adjust.
1453
- * @param ids - Product IDs.
1454
- * @public
1455
- * @documentationMaturity preview
1456
- * @requiredField adjust
1457
- * @requiredField ids
1458
- * @permissionScope Manage Stores - all permissions
1459
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1460
- * @permissionScope Manage Products
1461
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1462
- * @applicableIdentity APP
1463
- */
1464
- function bulkAdjustProductProperty(adjust, ids) {
1465
- var _a, _b, _c;
1466
- return __awaiter(this, arguments, void 0, function* () {
1467
- const requestTransformation = { adjust: '$[0]', ids: '$[1]' };
1468
- const responseTransformation = '$';
1469
- // @ts-ignore
1470
- const { httpClient, sideEffects } = arguments[2];
1471
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1472
- rootSchema: _bulkAdjustProductPropertiesRequest,
1473
- depSchemas: {},
1474
- fqdnTransformation: {
1475
- paths: [],
1476
- transformation: _fromVeloEntity,
1477
- },
1478
- customTransformation: requestTransformation,
1479
- });
1480
- const { fromJSON } = (0, velo_1.serializer)({
1481
- rootSchema: _bulkAdjustProductPropertiesResponse,
1482
- depSchemas: {},
1483
- fqdnTransformation: {
1484
- paths: [],
1485
- transformation: _toVeloEntity,
1486
- },
1487
- customTransformation: responseTransformation,
1488
- });
1489
- const payload = toAmbassadorRequest([adjust, ids]);
1490
- const reqOpts = ambassadorWixStoresCatalogV1Product.bulkAdjustProductProperties(payload);
1491
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1492
- try {
1493
- const result = yield httpClient.request(reqOpts);
1494
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1495
- return fromJSON(result.data);
1496
- }
1497
- catch (err) {
1498
- const transformedError = (0, transform_error_1.transformError)(err, {
1499
- spreadPathsToArguments: {},
1500
- explicitPathsToArguments: { adjust: '$[0]', ids: '$[1]' },
1501
- singleArgumentUnchanged: false,
1502
- }, ['adjust', 'ids']);
1503
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1504
- throw transformedError;
1505
- }
1506
- });
1507
- }
1508
- exports.bulkAdjustProductProperty = bulkAdjustProductProperty;
1509
- /**
1510
- * Creates a new product.
1511
- * @param product - Product information.
1512
- * @public
1513
- * @documentationMaturity preview
1514
- * @requiredField product
1515
- * @requiredField product.costAndProfitData.itemCost
1516
- * @requiredField product.name
1517
- * @requiredField product.priceData
1518
- * @requiredField product.priceData.price
1519
- */
1520
- function writeProxyCreateProductPlatformized(product) {
1521
- var _a, _b, _c;
1522
- return __awaiter(this, arguments, void 0, function* () {
1523
- const requestTransformation = { product: '$[0]' };
1524
- const responseTransformation = '$.product';
1525
- // @ts-ignore
1526
- const { httpClient, sideEffects } = arguments[1];
1527
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1528
- rootSchema: _v1CreateProductPlatformizedRequest,
1529
- depSchemas: {},
1530
- fqdnTransformation: {
1531
- paths: [...['product']],
1532
- transformation: _fromVeloEntity,
1533
- },
1534
- customTransformation: requestTransformation,
1535
- });
1536
- const { fromJSON } = (0, velo_1.serializer)({
1537
- rootSchema: _v1CreateProductPlatformizedResponse,
1538
- depSchemas: {},
1539
- fqdnTransformation: {
1540
- paths: [...['product']],
1541
- transformation: _toVeloEntity,
1542
- },
1543
- customTransformation: responseTransformation,
1544
- });
1545
- const payload = toAmbassadorRequest([product]);
1546
- const reqOpts = ambassadorWixStoresCatalogV1Product.writeProxyCreateProductPlatformized(payload);
1547
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1548
- try {
1549
- const result = yield httpClient.request(reqOpts);
1550
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1551
- return fromJSON(result.data);
1552
- }
1553
- catch (err) {
1554
- const transformedError = (0, transform_error_1.transformError)(err, {
1555
- spreadPathsToArguments: {},
1556
- explicitPathsToArguments: { product: '$[0]' },
1557
- singleArgumentUnchanged: false,
1558
- }, ['product']);
1559
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1560
- throw transformedError;
1561
- }
1562
- });
1563
- }
1564
- exports.writeProxyCreateProductPlatformized = writeProxyCreateProductPlatformized;
1565
- /**
1566
- * Updates specified fields in a product.
1567
- * @param _id - Product ID (generated automatically by the catalog).
1568
- * @public
1569
- * @documentationMaturity preview
1570
- * @requiredField _id
1571
- * @requiredField product
1572
- */
1573
- function writeProxyUpdateProductPlatformized(_id, product) {
1574
- var _a, _b, _c;
1575
- return __awaiter(this, arguments, void 0, function* () {
1576
- const requestTransformation = { product: { '*': '$[1]', id: '$[0]' } };
1577
- const responseTransformation = '$.product';
1578
- // @ts-ignore
1579
- const { httpClient, sideEffects } = arguments[2];
1580
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1581
- rootSchema: _v1UpdateProductPlatformizedRequest,
1582
- depSchemas: {},
1583
- fqdnTransformation: {
1584
- paths: [...['product']],
1585
- transformation: _fromVeloEntity,
1586
- },
1587
- customTransformation: requestTransformation,
1588
- });
1589
- const { fromJSON } = (0, velo_1.serializer)({
1590
- rootSchema: _v1UpdateProductPlatformizedResponse,
1591
- depSchemas: {},
1592
- fqdnTransformation: {
1593
- paths: [...['product']],
1594
- transformation: _toVeloEntity,
1595
- },
1596
- customTransformation: responseTransformation,
1597
- });
1598
- const payload = toAmbassadorRequest([_id, product]);
1599
- const reqOpts = ambassadorWixStoresCatalogV1Product.writeProxyUpdateProductPlatformized(payload);
1600
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1601
- try {
1602
- const result = yield httpClient.request(reqOpts);
1603
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1604
- return fromJSON(result.data);
1605
- }
1606
- catch (err) {
1607
- const transformedError = (0, transform_error_1.transformError)(err, {
1608
- spreadPathsToArguments: { product: '$[1]' },
1609
- explicitPathsToArguments: { 'product.id': '$[0]' },
1610
- singleArgumentUnchanged: false,
1611
- }, ['_id', 'product']);
1612
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1613
- throw transformedError;
1614
- }
1615
- });
1616
- }
1617
- exports.writeProxyUpdateProductPlatformized = writeProxyUpdateProductPlatformized;
1618
- /**
1619
- * Deletes a product.
1620
- * @param _id - ID of the product to delete.
1621
- * @public
1622
- * @documentationMaturity preview
1623
- * @requiredField _id
1624
- */
1625
- function writeProxyDeleteProductPlatformized(_id) {
1626
- var _a, _b, _c;
1627
- return __awaiter(this, arguments, void 0, function* () {
1628
- const requestTransformation = { id: '$[0]' };
1629
- const responseTransformation = '$';
1630
- // @ts-ignore
1631
- const { httpClient, sideEffects } = arguments[1];
1632
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1633
- rootSchema: _v1DeleteProductPlatformizedRequest,
1634
- depSchemas: {},
1635
- fqdnTransformation: {
1636
- paths: [],
1637
- transformation: _fromVeloEntity,
1638
- },
1639
- customTransformation: requestTransformation,
1640
- });
1641
- const { fromJSON } = (0, velo_1.serializer)({
1642
- rootSchema: _v1DeleteProductPlatformizedResponse,
1643
- depSchemas: {},
1644
- fqdnTransformation: {
1645
- paths: [],
1646
- transformation: _toVeloEntity,
1647
- },
1648
- customTransformation: responseTransformation,
1649
- });
1650
- const payload = toAmbassadorRequest([_id]);
1651
- const reqOpts = ambassadorWixStoresCatalogV1Product.writeProxyDeleteProductPlatformized(payload);
1652
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1653
- try {
1654
- const result = yield httpClient.request(reqOpts);
1655
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1656
- }
1657
- catch (err) {
1658
- const transformedError = (0, transform_error_1.transformError)(err, {
1659
- spreadPathsToArguments: {},
1660
- explicitPathsToArguments: { id: '$[0]' },
1661
- singleArgumentUnchanged: false,
1662
- }, ['_id']);
1663
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1664
- throw transformedError;
1665
- }
1666
- });
1667
- }
1668
- exports.writeProxyDeleteProductPlatformized = writeProxyDeleteProductPlatformized;
1669
- /**
1670
- * Returns a list of up to 100 products, given the provided paging, sorting and filtering.
1671
- * @public
1672
- * @documentationMaturity preview
1673
- * @permissionScope Manage Stores - all permissions
1674
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1675
- * @permissionScope Manage Products
1676
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1677
- * @permissionScope Read Stores - all read permissions
1678
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1679
- * @permissionScope Read Products
1680
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
1681
- * @permissionScope Manage Orders
1682
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1683
- * @applicableIdentity APP
1684
- * @applicableIdentity MEMBER
1685
- * @applicableIdentity VISITOR
1686
- */
1687
- function queryProducts() {
1688
- const requestTransformation = { '*': '$[1]', query: '$[0]' };
1689
- const responseTransformation = {
1690
- items: '$.products',
1691
- pagingMetadata: '$.metadata',
1692
- };
1693
- // @ts-ignore
1694
- const { httpClient, sideEffects } = arguments[0];
1695
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1696
- rootSchema: _queryProductsPlatformizedRequest,
1697
- depSchemas: {},
1698
- fqdnTransformation: {
1699
- paths: [],
1700
- transformation: _fromVeloEntity,
1701
- },
1702
- customTransformation: requestTransformation,
1703
- });
1704
- const { fromJSON } = (0, velo_1.serializer)({
1705
- rootSchema: _queryProductsPlatformizedResponse,
1706
- depSchemas: {},
1707
- fqdnTransformation: {
1708
- paths: [...['Array#products']],
1709
- transformation: _toVeloEntity,
1710
- },
1711
- customTransformation: responseTransformation,
1712
- });
1713
- return (0, motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder)({
1714
- func: (payload) => __awaiter(this, void 0, void 0, function* () {
1715
- var _a, _b, _c;
1716
- const reqOpts = ambassadorWixStoresCatalogV1Product.queryProductsPlatformized(payload);
1717
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1718
- try {
1719
- const result = yield httpClient.request(reqOpts);
1720
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1721
- return result;
1722
- }
1723
- catch (err) {
1724
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1725
- throw err;
1726
- }
1727
- }),
1728
- requestTransformer: (...args) => toAmbassadorRequest(args),
1729
- responseTransformer: ({ data }) => fromJSON(data),
1730
- errorTransformer: (err) => {
1731
- const transformedError = (0, velo_1.transformError)(err, requestTransformation);
1732
- throw transformedError;
1733
- },
1734
- pagingMethod: 'OFFSET',
1735
- transformationPaths: (0, velo_1.resolveQueryFieldsTransformationPaths)(_toVeloEntity),
1736
- })({ cursorWithEmptyFilterAndSort: true });
1737
- }
1738
- exports.queryProducts = queryProducts;
1739
- /**
1740
- * Retrieves a product with the provided ID.
1741
- * @param _id - Requested product ID.
1742
- * @public
1743
- * @documentationMaturity preview
1744
- * @requiredField _id
1745
- * @permissionScope Manage Stores - all permissions
1746
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1747
- * @permissionScope Manage Products
1748
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1749
- * @permissionScope Read Stores - all read permissions
1750
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1751
- * @permissionScope Read Products
1752
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
1753
- * @permissionScope Manage Orders
1754
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1755
- * @applicableIdentity APP
1756
- * @applicableIdentity MEMBER
1757
- * @applicableIdentity VISITOR
1758
- */
1759
- function getProduct(_id, options) {
1760
- var _a, _b, _c;
1761
- return __awaiter(this, arguments, void 0, function* () {
1762
- const requestTransformation = {
1763
- id: '$[0]',
1764
- includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
1765
- };
1766
- const responseTransformation = '$';
1767
- // @ts-ignore
1768
- const { httpClient, sideEffects } = arguments[2];
1769
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1770
- rootSchema: _getProductRequest,
1771
- depSchemas: {},
1772
- fqdnTransformation: {
1773
- paths: [],
1774
- transformation: _fromVeloEntity,
1775
- },
1776
- customTransformation: requestTransformation,
1777
- });
1778
- const { fromJSON } = (0, velo_1.serializer)({
1779
- rootSchema: _getProductResponse,
1780
- depSchemas: {},
1781
- fqdnTransformation: {
1782
- paths: [...['product']],
1783
- transformation: _toVeloEntity,
1784
- },
1785
- customTransformation: responseTransformation,
1786
- });
1787
- const payload = toAmbassadorRequest([_id, options]);
1788
- const reqOpts = ambassadorWixStoresCatalogV1Product.getProduct(payload);
1789
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1790
- try {
1791
- const result = yield httpClient.request(reqOpts);
1792
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1793
- return fromJSON(result.data);
1794
- }
1795
- catch (err) {
1796
- const transformedError = (0, transform_error_1.transformError)(err, {
1797
- spreadPathsToArguments: {},
1798
- explicitPathsToArguments: {
1799
- id: '$[0]',
1800
- includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
1801
- },
1802
- singleArgumentUnchanged: false,
1803
- }, ['_id', 'options']);
1804
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1805
- throw transformedError;
1806
- }
1807
- });
1808
- }
1809
- exports.getProduct = getProduct;
1810
- /**
1811
- * Retrieves a product with the provided ID.
1812
- * @param _id - Requested product ID.
1813
- * @public
1814
- * @documentationMaturity preview
1815
- * @requiredField _id
1816
- * @permissionScope Manage Stores - all permissions
1817
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1818
- * @permissionScope Manage Products
1819
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1820
- * @permissionScope Read Stores - all read permissions
1821
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1822
- * @permissionScope Read Products
1823
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
1824
- * @permissionScope Manage Orders
1825
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1826
- * @applicableIdentity APP
1827
- * @applicableIdentity MEMBER
1828
- * @applicableIdentity VISITOR
1829
- * @returns Requested product data.
1830
- */
1831
- function getProductPlatformized(_id, options) {
1832
- var _a, _b, _c;
1833
- return __awaiter(this, arguments, void 0, function* () {
1834
- const requestTransformation = {
1835
- id: '$[0]',
1836
- includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
1837
- };
1838
- const responseTransformation = '$.product';
1839
- // @ts-ignore
1840
- const { httpClient, sideEffects } = arguments[2];
1841
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1842
- rootSchema: _getProductPlatformizedRequest,
1843
- depSchemas: {},
1844
- fqdnTransformation: {
1845
- paths: [],
1846
- transformation: _fromVeloEntity,
1847
- },
1848
- customTransformation: requestTransformation,
1849
- });
1850
- const { fromJSON } = (0, velo_1.serializer)({
1851
- rootSchema: _getProductPlatformizedResponse,
1852
- depSchemas: {},
1853
- fqdnTransformation: {
1854
- paths: [...['product']],
1855
- transformation: _toVeloEntity,
1856
- },
1857
- customTransformation: responseTransformation,
1858
- });
1859
- const payload = toAmbassadorRequest([_id, options]);
1860
- const reqOpts = ambassadorWixStoresCatalogV1Product.getProductPlatformized(payload);
1861
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1862
- try {
1863
- const result = yield httpClient.request(reqOpts);
1864
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1865
- return fromJSON(result.data);
1866
- }
1867
- catch (err) {
1868
- const transformedError = (0, transform_error_1.transformError)(err, {
1869
- spreadPathsToArguments: {},
1870
- explicitPathsToArguments: {
1871
- id: '$[0]',
1872
- includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
1873
- },
1874
- singleArgumentUnchanged: false,
1875
- }, ['_id', 'options']);
1876
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1877
- throw transformedError;
1878
- }
1879
- });
1880
- }
1881
- exports.getProductPlatformized = getProductPlatformized;
1882
- /**
1883
- * Retrieves a collection with the provided slug.
1884
- * @param slug - Slug of the collection to retrieve.
1885
- * @public
1886
- * @requiredField slug
1887
- * @permissionScope Manage Stores - all permissions
1888
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1889
- * @permissionScope Manage Products
1890
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1891
- * @permissionScope Read Stores - all read permissions
1892
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1893
- * @permissionScope Read Products
1894
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
1895
- * @permissionScope Manage Orders
1896
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1897
- * @applicableIdentity APP
1898
- * @applicableIdentity MEMBER
1899
- * @applicableIdentity VISITOR
1900
- */
1901
- function getCollectionBySlug(slug) {
1902
- var _a, _b, _c;
1903
- return __awaiter(this, arguments, void 0, function* () {
1904
- const requestTransformation = { slug: '$[0]' };
1905
- const responseTransformation = '$';
1906
- // @ts-ignore
1907
- const { httpClient, sideEffects } = arguments[1];
1908
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1909
- rootSchema: _getCollectionBySlugRequest,
1910
- depSchemas: {},
1911
- fqdnTransformation: {
1912
- paths: [],
1913
- transformation: _fromVeloEntity,
1914
- },
1915
- customTransformation: requestTransformation,
1916
- });
1917
- const { fromJSON } = (0, velo_1.serializer)({
1918
- rootSchema: _getCollectionBySlugResponse,
1919
- depSchemas: {},
1920
- fqdnTransformation: {
1921
- paths: [],
1922
- transformation: _toVeloEntity,
1923
- },
1924
- customTransformation: responseTransformation,
1925
- });
1926
- const payload = toAmbassadorRequest([slug]);
1927
- const reqOpts = ambassadorWixStoresCatalogV1Product.getCollectionBySlug(payload);
1928
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1929
- try {
1930
- const result = yield httpClient.request(reqOpts);
1931
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1932
- return fromJSON(result.data);
1933
- }
1934
- catch (err) {
1935
- const transformedError = (0, transform_error_1.transformError)(err, {
1936
- spreadPathsToArguments: {},
1937
- explicitPathsToArguments: { slug: '$[0]' },
1938
- singleArgumentUnchanged: false,
1939
- }, ['slug']);
1940
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1941
- throw transformedError;
1942
- }
1943
- });
1944
- }
1945
- exports.getCollectionBySlug = getCollectionBySlug;
1946
- /**
1947
- * Gets the availability of relevant product variants based on the product ID and selections provided. See [Use Cases](https://dev.wix.com/api/rest/wix-stores/catalog/use-cases) for an example.
1948
- * @param _id - Requested product ID.
1949
- * @param options - Array containing the selected options. For example, `["color": "Blue", "size": "Large"]`.
1950
- * @public
1951
- * @requiredField _id
1952
- * @requiredField options
1953
- * @permissionScope Manage Stores - all permissions
1954
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1955
- * @permissionScope Manage Products
1956
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1957
- * @permissionScope Read Stores - all read permissions
1958
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1959
- * @permissionScope Read Products
1960
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
1961
- * @permissionScope Manage Orders
1962
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1963
- * @applicableIdentity APP
1964
- * @applicableIdentity MEMBER
1965
- * @applicableIdentity VISITOR
1966
- */
1967
- function getProductOptionsAvailability(_id, options) {
1968
- var _a, _b, _c;
1969
- return __awaiter(this, arguments, void 0, function* () {
1970
- const requestTransformation = { id: '$[0]', options: '$[1]' };
1971
- const responseTransformation = '$';
1972
- // @ts-ignore
1973
- const { httpClient, sideEffects } = arguments[2];
1974
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1975
- rootSchema: _productOptionsAvailabilityRequest,
1976
- depSchemas: {},
1977
- fqdnTransformation: {
1978
- paths: [],
1979
- transformation: _fromVeloEntity,
1980
- },
1981
- customTransformation: requestTransformation,
1982
- });
1983
- const { fromJSON } = (0, velo_1.serializer)({
1984
- rootSchema: _productOptionsAvailabilityResponse,
1985
- depSchemas: {},
1986
- fqdnTransformation: {
1987
- paths: [],
1988
- transformation: _toVeloEntity,
1989
- },
1990
- customTransformation: responseTransformation,
1991
- });
1992
- const payload = toAmbassadorRequest([_id, options]);
1993
- const reqOpts = ambassadorWixStoresCatalogV1Product.productOptionsAvailability(payload);
1994
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1995
- try {
1996
- const result = yield httpClient.request(reqOpts);
1997
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1998
- return fromJSON(result.data);
1999
- }
2000
- catch (err) {
2001
- const transformedError = (0, transform_error_1.transformError)(err, {
2002
- spreadPathsToArguments: {},
2003
- explicitPathsToArguments: { id: '$[0]', options: '$[1]' },
2004
- singleArgumentUnchanged: false,
2005
- }, ['_id', 'options']);
2006
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
2007
- throw transformedError;
2008
- }
2009
- });
2010
- }
2011
- exports.getProductOptionsAvailability = getProductOptionsAvailability;
2012
- /**
2013
- * Retrieves product variants, based on either choices (option-choice key-value pairs) or variant IDs.
2014
- * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.
2015
- * @param _id - Requested product ID.
2016
- * @public
2017
- * @documentationMaturity preview
2018
- * @requiredField _id
2019
- * @permissionScope Manage Stores - all permissions
2020
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2021
- * @permissionScope Manage Products
2022
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
2023
- * @permissionScope Read Stores - all read permissions
2024
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
2025
- * @permissionScope Read Products
2026
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
2027
- * @permissionScope Manage Orders
2028
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2029
- * @applicableIdentity APP
2030
- * @applicableIdentity MEMBER
2031
- * @applicableIdentity VISITOR
2032
- */
2033
- function queryProductVariants(_id, options) {
2034
- var _a, _b, _c;
2035
- return __awaiter(this, arguments, void 0, function* () {
2036
- const requestTransformation = {
2037
- id: '$[0]',
2038
- choices: '$[1].choices',
2039
- variantIds: '$[1].variantIds',
2040
- paging: '$[1].paging',
2041
- includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
2042
- };
2043
- const responseTransformation = '$';
2044
- // @ts-ignore
2045
- const { httpClient, sideEffects } = arguments[2];
2046
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
2047
- rootSchema: _queryProductVariantsRequest,
2048
- depSchemas: {},
2049
- fqdnTransformation: {
2050
- paths: [],
2051
- transformation: _fromVeloEntity,
2052
- },
2053
- customTransformation: requestTransformation,
2054
- });
2055
- const { fromJSON } = (0, velo_1.serializer)({
2056
- rootSchema: _queryProductVariantsResponse,
2057
- depSchemas: {},
2058
- fqdnTransformation: {
2059
- paths: [],
2060
- transformation: _toVeloEntity,
2061
- },
2062
- customTransformation: responseTransformation,
2063
- });
2064
- const payload = toAmbassadorRequest([_id, options]);
2065
- const reqOpts = ambassadorWixStoresCatalogV1Product.queryProductVariants(payload);
2066
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
2067
- try {
2068
- const result = yield httpClient.request(reqOpts);
2069
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
2070
- return fromJSON(result.data);
2071
- }
2072
- catch (err) {
2073
- const transformedError = (0, transform_error_1.transformError)(err, {
2074
- spreadPathsToArguments: {},
2075
- explicitPathsToArguments: {
2076
- id: '$[0]',
2077
- choices: '$[1].choices',
2078
- variantIds: '$[1].variantIds',
2079
- paging: '$[1].paging',
2080
- includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
2081
- },
2082
- singleArgumentUnchanged: false,
2083
- }, ['_id', 'options']);
2084
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
2085
- throw transformedError;
2086
- }
2087
- });
2088
- }
2089
- exports.queryProductVariants = queryProductVariants;
2090
- /**
2091
- * Retrieves up to 100 store variants, given the provided paging, filtering, and sorting.
2092
- * @param query - Query options.
2093
- * @public
2094
- * @documentationMaturity preview
2095
- * @requiredField query
2096
- * @permissionScope Manage Stores - all permissions
2097
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2098
- * @permissionScope Manage Products
2099
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
2100
- * @permissionScope Read Stores - all read permissions
2101
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
2102
- * @permissionScope Read Products
2103
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
2104
- * @permissionScope Manage Orders
2105
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2106
- * @applicableIdentity APP
2107
- * @applicableIdentity MEMBER
2108
- * @applicableIdentity VISITOR
2109
- */
2110
- function queryStoreVariants(query) {
2111
- var _a, _b, _c;
2112
- return __awaiter(this, arguments, void 0, function* () {
2113
- const requestTransformation = { query: '$[0]' };
2114
- const responseTransformation = '$';
2115
- // @ts-ignore
2116
- const { httpClient, sideEffects } = arguments[1];
2117
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
2118
- rootSchema: _queryStoreVariantsRequest,
2119
- depSchemas: {},
2120
- fqdnTransformation: {
2121
- paths: [],
2122
- transformation: _fromVeloEntity,
2123
- },
2124
- customTransformation: requestTransformation,
2125
- });
2126
- const { fromJSON } = (0, velo_1.serializer)({
2127
- rootSchema: _queryStoreVariantsResponse,
2128
- depSchemas: { _platformMedia, _storeVariant },
2129
- fqdnTransformation: {
2130
- paths: [],
2131
- transformation: _toVeloEntity,
2132
- },
2133
- customTransformation: responseTransformation,
2134
- });
2135
- const payload = toAmbassadorRequest([query]);
2136
- const reqOpts = ambassadorWixStoresCatalogV1Product.queryStoreVariants(payload);
2137
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
2138
- try {
2139
- const result = yield httpClient.request(reqOpts);
2140
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
2141
- return fromJSON(result.data);
2142
- }
2143
- catch (err) {
2144
- const transformedError = (0, transform_error_1.transformError)(err, {
2145
- spreadPathsToArguments: {},
2146
- explicitPathsToArguments: { query: '$[0]' },
2147
- singleArgumentUnchanged: false,
2148
- }, ['query']);
2149
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
2150
- throw transformedError;
2151
- }
2152
- });
2153
- }
2154
- exports.queryStoreVariants = queryStoreVariants;
2155
- /**
2156
- * Retrieves a store variant with the provided ID.
2157
- * @param _id - Store variant ID. Comprised of the `productId` and the `variantId`, separated by a hyphen. For example, `{productId}-{variantId}`.
2158
- * @public
2159
- * @documentationMaturity preview
2160
- * @requiredField _id
2161
- * @permissionScope Manage Stores - all permissions
2162
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2163
- * @permissionScope Manage Products
2164
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
2165
- * @permissionScope Read Stores - all read permissions
2166
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
2167
- * @permissionScope Read Products
2168
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
2169
- * @permissionScope Manage Orders
2170
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2171
- * @applicableIdentity APP
2172
- * @applicableIdentity MEMBER
2173
- * @applicableIdentity VISITOR
2174
- */
2175
- function getStoreVariant(_id) {
2176
- var _a, _b, _c;
2177
- return __awaiter(this, arguments, void 0, function* () {
2178
- const requestTransformation = { id: '$[0]' };
2179
- const responseTransformation = '$';
2180
- // @ts-ignore
2181
- const { httpClient, sideEffects } = arguments[1];
2182
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
2183
- rootSchema: _getStoreVariantRequest,
2184
- depSchemas: {},
2185
- fqdnTransformation: {
2186
- paths: [],
2187
- transformation: _fromVeloEntity,
2188
- },
2189
- customTransformation: requestTransformation,
2190
- });
2191
- const { fromJSON } = (0, velo_1.serializer)({
2192
- rootSchema: _getStoreVariantResponse,
2193
- depSchemas: { _platformMedia, _storeVariant },
2194
- fqdnTransformation: {
2195
- paths: [],
2196
- transformation: _toVeloEntity,
2197
- },
2198
- customTransformation: responseTransformation,
2199
- });
2200
- const payload = toAmbassadorRequest([_id]);
2201
- const reqOpts = ambassadorWixStoresCatalogV1Product.getStoreVariant(payload);
2202
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
2203
- try {
2204
- const result = yield httpClient.request(reqOpts);
2205
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
2206
- return fromJSON(result.data);
2207
- }
2208
- catch (err) {
2209
- const transformedError = (0, transform_error_1.transformError)(err, {
2210
- spreadPathsToArguments: {},
2211
- explicitPathsToArguments: { id: '$[0]' },
2212
- singleArgumentUnchanged: false,
2213
- }, ['_id']);
2214
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
2215
- throw transformedError;
2216
- }
2217
- });
2218
- }
2219
- exports.getStoreVariant = getStoreVariant;
2220
- //# sourceMappingURL=stores-catalog-v1-product.universal.js.map