@wix/stores 1.0.134 → 1.0.136

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,855 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { serializer } from '@wix/metro-runtime/velo';
11
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
12
- import * as ambassadorWixStoresV1SubscriptionOption from './stores-v1-subscription-option.http';
13
- const _toVeloEntity = '$';
14
- const _fromVeloEntity = '$';
15
- /** Frequency unit of recurring payment */
16
- export var SubscriptionFrequency;
17
- (function (SubscriptionFrequency) {
18
- SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
19
- SubscriptionFrequency["DAY"] = "DAY";
20
- SubscriptionFrequency["WEEK"] = "WEEK";
21
- SubscriptionFrequency["MONTH"] = "MONTH";
22
- SubscriptionFrequency["YEAR"] = "YEAR";
23
- })(SubscriptionFrequency || (SubscriptionFrequency = {}));
24
- export var DiscountType;
25
- (function (DiscountType) {
26
- DiscountType["UNDEFINED"] = "UNDEFINED";
27
- /** No discount */
28
- DiscountType["AMOUNT"] = "AMOUNT";
29
- DiscountType["PERCENT"] = "PERCENT";
30
- })(DiscountType || (DiscountType = {}));
31
- const _allowOneTimePurchasesRequest = {};
32
- const _allowOneTimePurchasesResponse = {};
33
- const _assignSubscriptionOptionsToProductRequest = {};
34
- const _assignSubscriptionOptionsToProductResponse = {};
35
- const _bulkCreateSubscriptionOptionsRequest = {};
36
- const _bulkCreateSubscriptionOptionsResponse = {};
37
- const _bulkDeleteSubscriptionOptionsRequest = {};
38
- const _bulkDeleteSubscriptionOptionsResponse = {};
39
- const _bulkUpdateSubscriptionOptionsRequest = {};
40
- const _bulkUpdateSubscriptionOptionsResponse = {};
41
- const _createSubscriptionOptionRequest = {};
42
- const _createSubscriptionOptionResponse = {};
43
- const _deleteSubscriptionOptionRequest = {};
44
- const _deleteSubscriptionOptionResponse = {};
45
- const _getOneTimePurchasesStatusRequest = {};
46
- const _getOneTimePurchasesStatusResponse = {};
47
- const _getProductIdsForSubscriptionOptionRequest = {};
48
- const _getProductIdsForSubscriptionOptionResponse = {};
49
- const _getSubscriptionOptionRequest = {};
50
- const _getSubscriptionOptionResponse = {};
51
- const _getSubscriptionOptionsForProductRequest = {};
52
- const _getSubscriptionOptionsForProductResponse = {};
53
- const _updateSubscriptionOptionRequest = {};
54
- const _updateSubscriptionOptionResponse = {};
55
- /**
56
- * Creates a subscription option.
57
- * To assign to a product, call [`assignSubscriptionOptionsToProduct()`](https://www.wix.com/velo/reference/wix-stores-v2/subscriptionoptions/assign-subscription-options-to-product).
58
- * Subscription options that are not assigned to a product will not be visible in the Wix business manager.
59
- * @param subscriptionOption - Subscription option info.
60
- * @public
61
- * @documentationMaturity preview
62
- * @requiredField subscriptionOption
63
- * @requiredField subscriptionOption.subscriptionSettings
64
- * @requiredField subscriptionOption.title
65
- * @permissionScope Manage Stores - all permissions
66
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
67
- * @permissionScope Manage Products
68
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
69
- * @applicableIdentity APP
70
- * @returns Newly created subscription option.
71
- */
72
- export function createSubscriptionOption(subscriptionOption) {
73
- var _a, _b, _c;
74
- return __awaiter(this, arguments, void 0, function* () {
75
- const requestTransformation = { subscriptionOption: '$[0]' };
76
- const responseTransformation = '$.subscriptionOption';
77
- // @ts-ignore
78
- const { httpClient, sideEffects } = arguments[1];
79
- const { toAmbassadorRequest } = serializer({
80
- rootSchema: _createSubscriptionOptionRequest,
81
- depSchemas: {},
82
- fqdnTransformation: {
83
- paths: [...['subscriptionOption']],
84
- transformation: _fromVeloEntity,
85
- },
86
- customTransformation: requestTransformation,
87
- });
88
- const { fromJSON } = serializer({
89
- rootSchema: _createSubscriptionOptionResponse,
90
- depSchemas: {},
91
- fqdnTransformation: {
92
- paths: [...['subscriptionOption']],
93
- transformation: _toVeloEntity,
94
- },
95
- customTransformation: responseTransformation,
96
- });
97
- const payload = toAmbassadorRequest([subscriptionOption]);
98
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.createSubscriptionOption(payload);
99
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
100
- try {
101
- const result = yield httpClient.request(reqOpts);
102
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
103
- return fromJSON(result.data);
104
- }
105
- catch (err) {
106
- const transformedError = sdkTransformError(err, {
107
- spreadPathsToArguments: {},
108
- explicitPathsToArguments: { subscriptionOption: '$[0]' },
109
- singleArgumentUnchanged: false,
110
- }, ['subscriptionOption']);
111
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
112
- throw transformedError;
113
- }
114
- });
115
- }
116
- /**
117
- * Updates a subscription option.
118
- * Only parameters passed will be updated.
119
- * <blockquote class='warning'>
120
- *
121
- * __Deprecation Notice:__
122
- *
123
- * This endpoint has been deprecated and will be removed on January 29, 2024.
124
- *
125
- * </blockquote>
126
- * @param _id - Subscription option ID (auto-generated upon subscription option creation).
127
- * @public
128
- * @documentationMaturity preview
129
- * @requiredField _id
130
- * @requiredField subscriptionOption
131
- * @param subscriptionOption - Subscription option update options.
132
- * @permissionScope Manage Stores - all permissions
133
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
134
- * @permissionScope Manage Products
135
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
136
- * @applicableIdentity APP
137
- * @returns Updated subscription option.
138
- */
139
- export function updateSubscriptionOption(_id, subscriptionOption) {
140
- var _a, _b, _c;
141
- return __awaiter(this, arguments, void 0, function* () {
142
- const requestTransformation = {
143
- subscriptionOption: { '*': '$[1]', id: '$[0]' },
144
- };
145
- const responseTransformation = '$.subscriptionOption';
146
- // @ts-ignore
147
- const { httpClient, sideEffects } = arguments[2];
148
- const { toAmbassadorRequest } = serializer({
149
- rootSchema: _updateSubscriptionOptionRequest,
150
- depSchemas: {},
151
- fqdnTransformation: {
152
- paths: [...['subscriptionOption']],
153
- transformation: _fromVeloEntity,
154
- },
155
- customTransformation: requestTransformation,
156
- });
157
- const { fromJSON } = serializer({
158
- rootSchema: _updateSubscriptionOptionResponse,
159
- depSchemas: {},
160
- fqdnTransformation: {
161
- paths: [...['subscriptionOption']],
162
- transformation: _toVeloEntity,
163
- },
164
- customTransformation: responseTransformation,
165
- });
166
- const payload = toAmbassadorRequest([_id, subscriptionOption]);
167
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.updateSubscriptionOption(payload);
168
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
169
- try {
170
- const result = yield httpClient.request(reqOpts);
171
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
172
- return fromJSON(result.data);
173
- }
174
- catch (err) {
175
- const transformedError = sdkTransformError(err, {
176
- spreadPathsToArguments: { subscriptionOption: '$[1]' },
177
- explicitPathsToArguments: { 'subscriptionOption.id': '$[0]' },
178
- singleArgumentUnchanged: false,
179
- }, ['_id', 'subscriptionOption']);
180
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
181
- throw transformedError;
182
- }
183
- });
184
- }
185
- /**
186
- * Deletes a subscription option.
187
- * <blockquote class='warning'>
188
- *
189
- * __Deprecation Notice:__
190
- *
191
- * This endpoint has been deprecated and will be removed on January 29, 2024.
192
- *
193
- * </blockquote>
194
- * @param _id - ID of the subscription option to delete.
195
- * @public
196
- * @documentationMaturity preview
197
- * @requiredField _id
198
- * @permissionScope Manage Stores - all permissions
199
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
200
- * @permissionScope Manage Products
201
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
202
- * @applicableIdentity APP
203
- */
204
- export function deleteSubscriptionOption(_id) {
205
- var _a, _b, _c;
206
- return __awaiter(this, arguments, void 0, function* () {
207
- const requestTransformation = { id: '$[0]' };
208
- const responseTransformation = '$';
209
- // @ts-ignore
210
- const { httpClient, sideEffects } = arguments[1];
211
- const { toAmbassadorRequest } = serializer({
212
- rootSchema: _deleteSubscriptionOptionRequest,
213
- depSchemas: {},
214
- fqdnTransformation: {
215
- paths: [],
216
- transformation: _fromVeloEntity,
217
- },
218
- customTransformation: requestTransformation,
219
- });
220
- const { fromJSON } = serializer({
221
- rootSchema: _deleteSubscriptionOptionResponse,
222
- depSchemas: {},
223
- fqdnTransformation: {
224
- paths: [],
225
- transformation: _toVeloEntity,
226
- },
227
- customTransformation: responseTransformation,
228
- });
229
- const payload = toAmbassadorRequest([_id]);
230
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.deleteSubscriptionOption(payload);
231
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
232
- try {
233
- const result = yield httpClient.request(reqOpts);
234
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
235
- }
236
- catch (err) {
237
- const transformedError = sdkTransformError(err, {
238
- spreadPathsToArguments: {},
239
- explicitPathsToArguments: { id: '$[0]' },
240
- singleArgumentUnchanged: false,
241
- }, ['_id']);
242
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
243
- throw transformedError;
244
- }
245
- });
246
- }
247
- /**
248
- * Creates multiple subscription options (up to 100).
249
- * To assign to a product, call [`assignSubscriptionOptionsToProduct()`](https://www.wix.com/velo/reference/wix-stores-v2/subscriptionoptions/assign-subscription-options-to-product).
250
- * Subscription options that are not assigned to a product will not be visible in the Wix business manager.
251
- * @param subscriptionOptions - Subscription options info.
252
- * @public
253
- * @documentationMaturity preview
254
- * @requiredField subscriptionOptions
255
- * @requiredField subscriptionOptions.subscriptionSettings
256
- * @requiredField subscriptionOptions.title
257
- * @permissionScope Manage Stores - all permissions
258
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
259
- * @permissionScope Manage Products
260
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
261
- * @applicableIdentity APP
262
- */
263
- export function bulkCreateSubscriptionOptions(subscriptionOptions) {
264
- var _a, _b, _c;
265
- return __awaiter(this, arguments, void 0, function* () {
266
- const requestTransformation = { subscriptionOptions: '$[0]' };
267
- const responseTransformation = '$';
268
- // @ts-ignore
269
- const { httpClient, sideEffects } = arguments[1];
270
- const { toAmbassadorRequest } = serializer({
271
- rootSchema: _bulkCreateSubscriptionOptionsRequest,
272
- depSchemas: {},
273
- fqdnTransformation: {
274
- paths: [...['Array#subscriptionOptions']],
275
- transformation: _fromVeloEntity,
276
- },
277
- customTransformation: requestTransformation,
278
- });
279
- const { fromJSON } = serializer({
280
- rootSchema: _bulkCreateSubscriptionOptionsResponse,
281
- depSchemas: {},
282
- fqdnTransformation: {
283
- paths: [...['Array#subscriptionOptions']],
284
- transformation: _toVeloEntity,
285
- },
286
- customTransformation: responseTransformation,
287
- });
288
- const payload = toAmbassadorRequest([subscriptionOptions]);
289
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.bulkCreateSubscriptionOptions(payload);
290
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
291
- try {
292
- const result = yield httpClient.request(reqOpts);
293
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
294
- return fromJSON(result.data);
295
- }
296
- catch (err) {
297
- const transformedError = sdkTransformError(err, {
298
- spreadPathsToArguments: {},
299
- explicitPathsToArguments: { subscriptionOptions: '$[0]' },
300
- singleArgumentUnchanged: false,
301
- }, ['subscriptionOptions']);
302
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
303
- throw transformedError;
304
- }
305
- });
306
- }
307
- /**
308
- * Updates multiple subscription options.
309
- * Only parameters passed will be updated.
310
- * <blockquote class='warning'>
311
- *
312
- * __Deprecation Notice:__
313
- *
314
- * This endpoint has been deprecated and will be removed on January 29, 2024.
315
- *
316
- * </blockquote>
317
- * @param subscriptionOptions - Subscription options info. Only the passed parameters in each subscription option will be updated.
318
- * @public
319
- * @documentationMaturity preview
320
- * @requiredField subscriptionOptions
321
- * @requiredField subscriptionOptions._id
322
- * @permissionScope Manage Stores - all permissions
323
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
324
- * @permissionScope Manage Products
325
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
326
- * @applicableIdentity APP
327
- */
328
- export function bulkUpdateSubscriptionOptions(subscriptionOptions) {
329
- var _a, _b, _c;
330
- return __awaiter(this, arguments, void 0, function* () {
331
- const requestTransformation = { subscriptionOptions: '$[0]' };
332
- const responseTransformation = '$';
333
- // @ts-ignore
334
- const { httpClient, sideEffects } = arguments[1];
335
- const { toAmbassadorRequest } = serializer({
336
- rootSchema: _bulkUpdateSubscriptionOptionsRequest,
337
- depSchemas: {},
338
- fqdnTransformation: {
339
- paths: [...['Array#subscriptionOptions']],
340
- transformation: _fromVeloEntity,
341
- },
342
- customTransformation: requestTransformation,
343
- });
344
- const { fromJSON } = serializer({
345
- rootSchema: _bulkUpdateSubscriptionOptionsResponse,
346
- depSchemas: {},
347
- fqdnTransformation: {
348
- paths: [...['Array#subscriptionOptions']],
349
- transformation: _toVeloEntity,
350
- },
351
- customTransformation: responseTransformation,
352
- });
353
- const payload = toAmbassadorRequest([subscriptionOptions]);
354
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.bulkUpdateSubscriptionOptions(payload);
355
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
356
- try {
357
- const result = yield httpClient.request(reqOpts);
358
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
359
- return fromJSON(result.data);
360
- }
361
- catch (err) {
362
- const transformedError = sdkTransformError(err, {
363
- spreadPathsToArguments: {},
364
- explicitPathsToArguments: { subscriptionOptions: '$[0]' },
365
- singleArgumentUnchanged: false,
366
- }, ['subscriptionOptions']);
367
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
368
- throw transformedError;
369
- }
370
- });
371
- }
372
- /**
373
- * Deletes multiple subscription options.
374
- * <blockquote class='warning'>
375
- *
376
- * __Deprecation Notice:__
377
- *
378
- * This endpoint has been deprecated and will be removed on January 29, 2024.
379
- *
380
- * </blockquote>
381
- * @param ids - IDs of the subscription options to delete.
382
- * @public
383
- * @documentationMaturity preview
384
- * @requiredField ids
385
- * @permissionScope Manage Stores - all permissions
386
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
387
- * @permissionScope Manage Products
388
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
389
- * @applicableIdentity APP
390
- */
391
- export function bulkDeleteSubscriptionOptions(ids) {
392
- var _a, _b, _c;
393
- return __awaiter(this, arguments, void 0, function* () {
394
- const requestTransformation = { ids: '$[0]' };
395
- const responseTransformation = '$';
396
- // @ts-ignore
397
- const { httpClient, sideEffects } = arguments[1];
398
- const { toAmbassadorRequest } = serializer({
399
- rootSchema: _bulkDeleteSubscriptionOptionsRequest,
400
- depSchemas: {},
401
- fqdnTransformation: {
402
- paths: [],
403
- transformation: _fromVeloEntity,
404
- },
405
- customTransformation: requestTransformation,
406
- });
407
- const { fromJSON } = serializer({
408
- rootSchema: _bulkDeleteSubscriptionOptionsResponse,
409
- depSchemas: {},
410
- fqdnTransformation: {
411
- paths: [],
412
- transformation: _toVeloEntity,
413
- },
414
- customTransformation: responseTransformation,
415
- });
416
- const payload = toAmbassadorRequest([ids]);
417
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.bulkDeleteSubscriptionOptions(payload);
418
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
419
- try {
420
- const result = yield httpClient.request(reqOpts);
421
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
422
- }
423
- catch (err) {
424
- const transformedError = sdkTransformError(err, {
425
- spreadPathsToArguments: {},
426
- explicitPathsToArguments: { ids: '$[0]' },
427
- singleArgumentUnchanged: false,
428
- }, ['ids']);
429
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
430
- throw transformedError;
431
- }
432
- });
433
- }
434
- /**
435
- * Assign up to 6 subscription options to a specified product.
436
- * Pass an empty array to remove all subscription options assigned to a product.
437
- * <blockquote class='warning'>
438
- *
439
- * __Deprecation Notice:__
440
- *
441
- * This endpoint has been deprecated and will be removed on January 29, 2024.
442
- *
443
- * </blockquote>
444
- * @param productId - Product ID.
445
- * @public
446
- * @documentationMaturity preview
447
- * @requiredField productId
448
- * @param options - Subscription option assignment options.
449
- * @permissionScope Manage Stores - all permissions
450
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
451
- * @permissionScope Manage Products
452
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
453
- * @applicableIdentity APP
454
- */
455
- export function assignSubscriptionOptionsToProduct(productId, options) {
456
- var _a, _b, _c;
457
- return __awaiter(this, arguments, void 0, function* () {
458
- const requestTransformation = {
459
- productId: '$[0]',
460
- assignedSubscriptionOptions: '$[1].assignedSubscriptionOptions',
461
- };
462
- const responseTransformation = '$';
463
- // @ts-ignore
464
- const { httpClient, sideEffects } = arguments[2];
465
- const { toAmbassadorRequest } = serializer({
466
- rootSchema: _assignSubscriptionOptionsToProductRequest,
467
- depSchemas: {},
468
- fqdnTransformation: {
469
- paths: [],
470
- transformation: _fromVeloEntity,
471
- },
472
- customTransformation: requestTransformation,
473
- });
474
- const { fromJSON } = serializer({
475
- rootSchema: _assignSubscriptionOptionsToProductResponse,
476
- depSchemas: {},
477
- fqdnTransformation: {
478
- paths: [],
479
- transformation: _toVeloEntity,
480
- },
481
- customTransformation: responseTransformation,
482
- });
483
- const payload = toAmbassadorRequest([productId, options]);
484
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.assignSubscriptionOptionsToProduct(payload);
485
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
486
- try {
487
- const result = yield httpClient.request(reqOpts);
488
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
489
- }
490
- catch (err) {
491
- const transformedError = sdkTransformError(err, {
492
- spreadPathsToArguments: {},
493
- explicitPathsToArguments: {
494
- productId: '$[0]',
495
- assignedSubscriptionOptions: '$[1].assignedSubscriptionOptions',
496
- },
497
- singleArgumentUnchanged: false,
498
- }, ['productId', 'options']);
499
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
500
- throw transformedError;
501
- }
502
- });
503
- }
504
- /**
505
- * Allow for one-time purchase of a product.
506
- * By default, product can be sold only as part of a subscription, not as a one-time purchase.
507
- * <blockquote class='warning'>
508
- *
509
- * __Deprecation Notice:__
510
- *
511
- * This endpoint has been deprecated and will be removed on January 29, 2024.
512
- *
513
- * </blockquote>
514
- * @param productId - Product ID.
515
- * @param allowed - Pass `true` to offer product by subscription and as one-time purchase. Pass `false` to offer product as subscription only.
516
- * @public
517
- * @documentationMaturity preview
518
- * @requiredField allowed
519
- * @requiredField productId
520
- * @permissionScope Manage Stores - all permissions
521
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
522
- * @permissionScope Manage Products
523
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
524
- * @applicableIdentity APP
525
- */
526
- export function allowOneTimePurchases(productId, allowed) {
527
- var _a, _b, _c;
528
- return __awaiter(this, arguments, void 0, function* () {
529
- const requestTransformation = { productId: '$[0]', allowed: '$[1]' };
530
- const responseTransformation = '$';
531
- // @ts-ignore
532
- const { httpClient, sideEffects } = arguments[2];
533
- const { toAmbassadorRequest } = serializer({
534
- rootSchema: _allowOneTimePurchasesRequest,
535
- depSchemas: {},
536
- fqdnTransformation: {
537
- paths: [],
538
- transformation: _fromVeloEntity,
539
- },
540
- customTransformation: requestTransformation,
541
- });
542
- const { fromJSON } = serializer({
543
- rootSchema: _allowOneTimePurchasesResponse,
544
- depSchemas: {},
545
- fqdnTransformation: {
546
- paths: [],
547
- transformation: _toVeloEntity,
548
- },
549
- customTransformation: responseTransformation,
550
- });
551
- const payload = toAmbassadorRequest([productId, allowed]);
552
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.allowOneTimePurchases(payload);
553
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
554
- try {
555
- const result = yield httpClient.request(reqOpts);
556
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
557
- }
558
- catch (err) {
559
- const transformedError = sdkTransformError(err, {
560
- spreadPathsToArguments: {},
561
- explicitPathsToArguments: { productId: '$[0]', allowed: '$[1]' },
562
- singleArgumentUnchanged: false,
563
- }, ['productId', 'allowed']);
564
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
565
- throw transformedError;
566
- }
567
- });
568
- }
569
- /**
570
- * Retrieves a subscription option by ID.
571
- * <blockquote class='warning'>
572
- *
573
- * __Deprecation Notice:__
574
- *
575
- * This endpoint has been deprecated and will be removed on January 29, 2024.
576
- *
577
- * </blockquote>
578
- * @param _id - Subscription option ID.
579
- * @public
580
- * @documentationMaturity preview
581
- * @requiredField _id
582
- * @permissionScope Manage Stores - all permissions
583
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
584
- * @permissionScope Manage Products
585
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
586
- * @permissionScope Read Stores - all read permissions
587
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
588
- * @permissionScope Read Products
589
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
590
- * @applicableIdentity APP
591
- * @returns Subscription option.
592
- */
593
- export function getSubscriptionOption(_id) {
594
- var _a, _b, _c;
595
- return __awaiter(this, arguments, void 0, function* () {
596
- const requestTransformation = { id: '$[0]' };
597
- const responseTransformation = '$.subscriptionOption';
598
- // @ts-ignore
599
- const { httpClient, sideEffects } = arguments[1];
600
- const { toAmbassadorRequest } = serializer({
601
- rootSchema: _getSubscriptionOptionRequest,
602
- depSchemas: {},
603
- fqdnTransformation: {
604
- paths: [],
605
- transformation: _fromVeloEntity,
606
- },
607
- customTransformation: requestTransformation,
608
- });
609
- const { fromJSON } = serializer({
610
- rootSchema: _getSubscriptionOptionResponse,
611
- depSchemas: {},
612
- fqdnTransformation: {
613
- paths: [...['subscriptionOption']],
614
- transformation: _toVeloEntity,
615
- },
616
- customTransformation: responseTransformation,
617
- });
618
- const payload = toAmbassadorRequest([_id]);
619
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.getSubscriptionOption(payload);
620
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
621
- try {
622
- const result = yield httpClient.request(reqOpts);
623
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
624
- return fromJSON(result.data);
625
- }
626
- catch (err) {
627
- const transformedError = sdkTransformError(err, {
628
- spreadPathsToArguments: {},
629
- explicitPathsToArguments: { id: '$[0]' },
630
- singleArgumentUnchanged: false,
631
- }, ['_id']);
632
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
633
- throw transformedError;
634
- }
635
- });
636
- }
637
- /**
638
- * Retrieves all subscription options assigned to a specified product.
639
- * By default, hidden subscription options are not returned. To retrieve all subscription options you must pass `includeHiddenSubscriptionOptions = true`.
640
- * <blockquote class='warning'>
641
- *
642
- * __Deprecation Notice:__
643
- *
644
- * This endpoint has been deprecated and will be removed on January 29, 2024.
645
- *
646
- * </blockquote>
647
- * @param productId - Product ID.
648
- * @public
649
- * @documentationMaturity preview
650
- * @requiredField productId
651
- * @param options - Options.
652
- * @permissionScope Manage Stores - all permissions
653
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
654
- * @permissionScope Manage Products
655
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
656
- * @permissionScope Read Stores - all read permissions
657
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
658
- * @permissionScope Read Products
659
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
660
- * @applicableIdentity APP
661
- */
662
- export function getSubscriptionOptionsForProduct(productId, options) {
663
- var _a, _b, _c;
664
- return __awaiter(this, arguments, void 0, function* () {
665
- const requestTransformation = {
666
- productId: '$[0]',
667
- includeHiddenSubscriptionOptions: '$[1].includeHiddenSubscriptionOptions',
668
- };
669
- const responseTransformation = '$';
670
- // @ts-ignore
671
- const { httpClient, sideEffects } = arguments[2];
672
- const { toAmbassadorRequest } = serializer({
673
- rootSchema: _getSubscriptionOptionsForProductRequest,
674
- depSchemas: {},
675
- fqdnTransformation: {
676
- paths: [],
677
- transformation: _fromVeloEntity,
678
- },
679
- customTransformation: requestTransformation,
680
- });
681
- const { fromJSON } = serializer({
682
- rootSchema: _getSubscriptionOptionsForProductResponse,
683
- depSchemas: {},
684
- fqdnTransformation: {
685
- paths: [],
686
- transformation: _toVeloEntity,
687
- },
688
- customTransformation: responseTransformation,
689
- });
690
- const payload = toAmbassadorRequest([productId, options]);
691
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.getSubscriptionOptionsForProduct(payload);
692
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
693
- try {
694
- const result = yield httpClient.request(reqOpts);
695
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
696
- return fromJSON(result.data);
697
- }
698
- catch (err) {
699
- const transformedError = sdkTransformError(err, {
700
- spreadPathsToArguments: {},
701
- explicitPathsToArguments: {
702
- productId: '$[0]',
703
- includeHiddenSubscriptionOptions: '$[1].includeHiddenSubscriptionOptions',
704
- },
705
- singleArgumentUnchanged: false,
706
- }, ['productId', 'options']);
707
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
708
- throw transformedError;
709
- }
710
- });
711
- }
712
- /**
713
- * Retrieves the IDs of products associated with a specified subscription option.
714
- * <blockquote class='warning'>
715
- *
716
- * __Deprecation Notice:__
717
- *
718
- * This endpoint has been deprecated and will be removed on January 29, 2024.
719
- *
720
- * </blockquote>
721
- * @param _id - Subscription option ID.
722
- * @public
723
- * @documentationMaturity preview
724
- * @requiredField _id
725
- * @param options - Paging and other options.
726
- * @permissionScope Manage Stores - all permissions
727
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
728
- * @permissionScope Manage Products
729
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
730
- * @permissionScope Read Stores - all read permissions
731
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
732
- * @permissionScope Read Products
733
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
734
- * @applicableIdentity APP
735
- */
736
- export function getProductIdsForSubscriptionOption(_id, options) {
737
- var _a, _b, _c;
738
- return __awaiter(this, arguments, void 0, function* () {
739
- const requestTransformation = {
740
- id: '$[0]',
741
- includeHiddenProducts: '$[1].includeHiddenProducts',
742
- paging: '$[1].paging',
743
- };
744
- const responseTransformation = '$';
745
- // @ts-ignore
746
- const { httpClient, sideEffects } = arguments[2];
747
- const { toAmbassadorRequest } = serializer({
748
- rootSchema: _getProductIdsForSubscriptionOptionRequest,
749
- depSchemas: {},
750
- fqdnTransformation: {
751
- paths: [],
752
- transformation: _fromVeloEntity,
753
- },
754
- customTransformation: requestTransformation,
755
- });
756
- const { fromJSON } = serializer({
757
- rootSchema: _getProductIdsForSubscriptionOptionResponse,
758
- depSchemas: {},
759
- fqdnTransformation: {
760
- paths: [],
761
- transformation: _toVeloEntity,
762
- },
763
- customTransformation: responseTransformation,
764
- });
765
- const payload = toAmbassadorRequest([_id, options]);
766
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.getProductIdsForSubscriptionOption(payload);
767
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
768
- try {
769
- const result = yield httpClient.request(reqOpts);
770
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
771
- return fromJSON(result.data);
772
- }
773
- catch (err) {
774
- const transformedError = sdkTransformError(err, {
775
- spreadPathsToArguments: {},
776
- explicitPathsToArguments: {
777
- id: '$[0]',
778
- includeHiddenProducts: '$[1].includeHiddenProducts',
779
- paging: '$[1].paging',
780
- },
781
- singleArgumentUnchanged: false,
782
- }, ['_id', 'options']);
783
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
784
- throw transformedError;
785
- }
786
- });
787
- }
788
- /**
789
- * Checks whether a specified product (associated with subscription options) is available for one-time purchase.
790
- * <blockquote class='warning'>
791
- *
792
- * __Deprecation Notice:__
793
- *
794
- * This endpoint has been deprecated and will be removed on January 29, 2024.
795
- *
796
- * </blockquote>
797
- * @param productId - Product ID.
798
- * @public
799
- * @documentationMaturity preview
800
- * @requiredField productId
801
- * @permissionScope Manage Stores - all permissions
802
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
803
- * @permissionScope Manage Products
804
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
805
- * @permissionScope Read Stores - all read permissions
806
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
807
- * @permissionScope Read Products
808
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
809
- * @applicableIdentity APP
810
- */
811
- export function getOneTimePurchasesStatus(productId) {
812
- var _a, _b, _c;
813
- return __awaiter(this, arguments, void 0, function* () {
814
- const requestTransformation = { productId: '$[0]' };
815
- const responseTransformation = '$';
816
- // @ts-ignore
817
- const { httpClient, sideEffects } = arguments[1];
818
- const { toAmbassadorRequest } = serializer({
819
- rootSchema: _getOneTimePurchasesStatusRequest,
820
- depSchemas: {},
821
- fqdnTransformation: {
822
- paths: [],
823
- transformation: _fromVeloEntity,
824
- },
825
- customTransformation: requestTransformation,
826
- });
827
- const { fromJSON } = serializer({
828
- rootSchema: _getOneTimePurchasesStatusResponse,
829
- depSchemas: {},
830
- fqdnTransformation: {
831
- paths: [],
832
- transformation: _toVeloEntity,
833
- },
834
- customTransformation: responseTransformation,
835
- });
836
- const payload = toAmbassadorRequest([productId]);
837
- const reqOpts = ambassadorWixStoresV1SubscriptionOption.getOneTimePurchasesStatus(payload);
838
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
839
- try {
840
- const result = yield httpClient.request(reqOpts);
841
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
842
- return fromJSON(result.data);
843
- }
844
- catch (err) {
845
- const transformedError = sdkTransformError(err, {
846
- spreadPathsToArguments: {},
847
- explicitPathsToArguments: { productId: '$[0]' },
848
- singleArgumentUnchanged: false,
849
- }, ['productId']);
850
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
851
- throw transformedError;
852
- }
853
- });
854
- }
855
- //# sourceMappingURL=stores-v1-subscription-option.universal.js.map