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