@wix/pricing-plans 1.0.54 → 1.0.55

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 (97) hide show
  1. package/build/cjs/context.d.ts +2 -2
  2. package/build/cjs/context.js +2 -2
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +2 -2
  5. package/build/cjs/index.js +2 -2
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +2 -2
  8. package/build/cjs/meta.js +2 -2
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +2 -2
  11. package/build/es/context.js +2 -2
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +2 -2
  14. package/build/es/index.js +2 -2
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +2 -2
  17. package/build/es/meta.js +2 -2
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +12 -9
  20. package/build/cjs/index.typings.d.ts +0 -2
  21. package/build/cjs/index.typings.js +0 -29
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/pricing-plans-v2-order.context.d.ts +0 -15
  24. package/build/cjs/src/pricing-plans-v2-order.context.js +0 -148
  25. package/build/cjs/src/pricing-plans-v2-order.context.js.map +0 -1
  26. package/build/cjs/src/pricing-plans-v2-order.http.d.ts +0 -165
  27. package/build/cjs/src/pricing-plans-v2-order.http.js +0 -818
  28. package/build/cjs/src/pricing-plans-v2-order.http.js.map +0 -1
  29. package/build/cjs/src/pricing-plans-v2-order.meta.d.ts +0 -41
  30. package/build/cjs/src/pricing-plans-v2-order.meta.js +0 -275
  31. package/build/cjs/src/pricing-plans-v2-order.meta.js.map +0 -1
  32. package/build/cjs/src/pricing-plans-v2-order.public.d.ts +0 -104
  33. package/build/cjs/src/pricing-plans-v2-order.public.js +0 -110
  34. package/build/cjs/src/pricing-plans-v2-order.public.js.map +0 -1
  35. package/build/cjs/src/pricing-plans-v2-order.types.d.ts +0 -1801
  36. package/build/cjs/src/pricing-plans-v2-order.types.js +0 -135
  37. package/build/cjs/src/pricing-plans-v2-order.types.js.map +0 -1
  38. package/build/cjs/src/pricing-plans-v2-order.universal.d.ts +0 -2225
  39. package/build/cjs/src/pricing-plans-v2-order.universal.js +0 -1151
  40. package/build/cjs/src/pricing-plans-v2-order.universal.js.map +0 -1
  41. package/build/cjs/src/pricing-plans-v2-plan.context.d.ts +0 -14
  42. package/build/cjs/src/pricing-plans-v2-plan.context.js +0 -137
  43. package/build/cjs/src/pricing-plans-v2-plan.context.js.map +0 -1
  44. package/build/cjs/src/pricing-plans-v2-plan.http.d.ts +0 -134
  45. package/build/cjs/src/pricing-plans-v2-plan.http.js +0 -544
  46. package/build/cjs/src/pricing-plans-v2-plan.http.js.map +0 -1
  47. package/build/cjs/src/pricing-plans-v2-plan.meta.d.ts +0 -34
  48. package/build/cjs/src/pricing-plans-v2-plan.meta.js +0 -256
  49. package/build/cjs/src/pricing-plans-v2-plan.meta.js.map +0 -1
  50. package/build/cjs/src/pricing-plans-v2-plan.public.d.ts +0 -86
  51. package/build/cjs/src/pricing-plans-v2-plan.public.js +0 -89
  52. package/build/cjs/src/pricing-plans-v2-plan.public.js.map +0 -1
  53. package/build/cjs/src/pricing-plans-v2-plan.types.d.ts +0 -732
  54. package/build/cjs/src/pricing-plans-v2-plan.types.js +0 -41
  55. package/build/cjs/src/pricing-plans-v2-plan.types.js.map +0 -1
  56. package/build/cjs/src/pricing-plans-v2-plan.universal.d.ts +0 -1176
  57. package/build/cjs/src/pricing-plans-v2-plan.universal.js +0 -913
  58. package/build/cjs/src/pricing-plans-v2-plan.universal.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -2
  60. package/build/es/index.typings.js +0 -3
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/src/pricing-plans-v2-order.context.d.ts +0 -15
  63. package/build/es/src/pricing-plans-v2-order.context.js +0 -132
  64. package/build/es/src/pricing-plans-v2-order.context.js.map +0 -1
  65. package/build/es/src/pricing-plans-v2-order.http.d.ts +0 -165
  66. package/build/es/src/pricing-plans-v2-order.http.js +0 -802
  67. package/build/es/src/pricing-plans-v2-order.http.js.map +0 -1
  68. package/build/es/src/pricing-plans-v2-order.meta.d.ts +0 -41
  69. package/build/es/src/pricing-plans-v2-order.meta.js +0 -236
  70. package/build/es/src/pricing-plans-v2-order.meta.js.map +0 -1
  71. package/build/es/src/pricing-plans-v2-order.public.d.ts +0 -104
  72. package/build/es/src/pricing-plans-v2-order.public.js +0 -70
  73. package/build/es/src/pricing-plans-v2-order.public.js.map +0 -1
  74. package/build/es/src/pricing-plans-v2-order.types.d.ts +0 -1801
  75. package/build/es/src/pricing-plans-v2-order.types.js +0 -132
  76. package/build/es/src/pricing-plans-v2-order.types.js.map +0 -1
  77. package/build/es/src/pricing-plans-v2-order.universal.d.ts +0 -2225
  78. package/build/es/src/pricing-plans-v2-order.universal.js +0 -1112
  79. package/build/es/src/pricing-plans-v2-order.universal.js.map +0 -1
  80. package/build/es/src/pricing-plans-v2-plan.context.d.ts +0 -14
  81. package/build/es/src/pricing-plans-v2-plan.context.js +0 -122
  82. package/build/es/src/pricing-plans-v2-plan.context.js.map +0 -1
  83. package/build/es/src/pricing-plans-v2-plan.http.d.ts +0 -134
  84. package/build/es/src/pricing-plans-v2-plan.http.js +0 -529
  85. package/build/es/src/pricing-plans-v2-plan.http.js.map +0 -1
  86. package/build/es/src/pricing-plans-v2-plan.meta.d.ts +0 -34
  87. package/build/es/src/pricing-plans-v2-plan.meta.js +0 -218
  88. package/build/es/src/pricing-plans-v2-plan.meta.js.map +0 -1
  89. package/build/es/src/pricing-plans-v2-plan.public.d.ts +0 -86
  90. package/build/es/src/pricing-plans-v2-plan.public.js +0 -65
  91. package/build/es/src/pricing-plans-v2-plan.public.js.map +0 -1
  92. package/build/es/src/pricing-plans-v2-plan.types.d.ts +0 -732
  93. package/build/es/src/pricing-plans-v2-plan.types.js +0 -38
  94. package/build/es/src/pricing-plans-v2-plan.types.js.map +0 -1
  95. package/build/es/src/pricing-plans-v2-plan.universal.d.ts +0 -1176
  96. package/build/es/src/pricing-plans-v2-plan.universal.js +0 -875
  97. package/build/es/src/pricing-plans-v2-plan.universal.js.map +0 -1
@@ -1,875 +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, transformError, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
11
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
12
- import { EventDefinition } from '@wix/sdk-types';
13
- import * as ambassadorWixPricingPlansV2Plan from './pricing-plans-v2-plan.http';
14
- // @ts-ignore
15
- import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
16
- const _toVeloEntity = '$';
17
- const _fromVeloEntity = '$';
18
- export var PeriodUnit;
19
- (function (PeriodUnit) {
20
- PeriodUnit["UNDEFINED"] = "UNDEFINED";
21
- PeriodUnit["DAY"] = "DAY";
22
- PeriodUnit["WEEK"] = "WEEK";
23
- PeriodUnit["MONTH"] = "MONTH";
24
- PeriodUnit["YEAR"] = "YEAR";
25
- })(PeriodUnit || (PeriodUnit = {}));
26
- export var AppliedAt;
27
- (function (AppliedAt) {
28
- AppliedAt["UNKNOWN_CHARGE_EVENT"] = "UNKNOWN_CHARGE_EVENT";
29
- /** Will charge the fee on first payment. If order has a free trial meaning it will charge after the free trial. */
30
- AppliedAt["FIRST_PAYMENT"] = "FIRST_PAYMENT";
31
- })(AppliedAt || (AppliedAt = {}));
32
- export var SortOrder;
33
- (function (SortOrder) {
34
- SortOrder["ASC"] = "ASC";
35
- SortOrder["DESC"] = "DESC";
36
- })(SortOrder || (SortOrder = {}));
37
- export var ArchivedFilter;
38
- (function (ArchivedFilter) {
39
- /** Returns all plans that are active. */
40
- ArchivedFilter["ACTIVE"] = "ACTIVE";
41
- /** Returns all plans that are archived. */
42
- ArchivedFilter["ARCHIVED"] = "ARCHIVED";
43
- /** Returns all plans that are active and archived. */
44
- ArchivedFilter["ARCHIVED_AND_ACTIVE"] = "ARCHIVED_AND_ACTIVE";
45
- })(ArchivedFilter || (ArchivedFilter = {}));
46
- export var PublicFilter;
47
- (function (PublicFilter) {
48
- /** Returns all public and hidden plans. */
49
- PublicFilter["PUBLIC_AND_HIDDEN"] = "PUBLIC_AND_HIDDEN";
50
- /** Returns only public plans. */
51
- PublicFilter["PUBLIC"] = "PUBLIC";
52
- /** Returns only hidden plans. */
53
- PublicFilter["HIDDEN"] = "HIDDEN";
54
- })(PublicFilter || (PublicFilter = {}));
55
- const _archivePlanRequest = {};
56
- const _archivePlanResponse = {};
57
- const _arrangePlansRequest = {};
58
- const _arrangePlansResponse = {};
59
- const _clearPrimaryRequest = {};
60
- const _clearPrimaryResponse = {};
61
- const _createPlanRequest = {};
62
- const _createPlanResponse = {};
63
- const _getPlanRequest = {};
64
- const _getPlanResponse = {};
65
- const _getPlanStatsRequest = {};
66
- const _getPlanStatsResponse = {};
67
- const _listPlansRequest = {};
68
- const _listPlansResponse = {};
69
- const _listPublicPlansRequest = {};
70
- const _listPublicPlansResponse = {};
71
- const _makePlanPrimaryRequest = {};
72
- const _makePlanPrimaryResponse = {};
73
- const _queryPublicPlansRequest = {};
74
- const _queryPublicPlansResponse = {};
75
- const _setPlanVisibilityRequest = {};
76
- const _setPlanVisibilityResponse = {};
77
- const _updatePlanRequest = {};
78
- const _updatePlanResponse = {};
79
- export const onPlanUpdated = EventDefinition('wix.pricing_plans.v2.plan_updated')();
80
- export const onPlanCreated = EventDefinition('wix.pricing_plans.v2.plan_created')();
81
- export const onPlanBuyerCanCancelUpdated = EventDefinition('wix.pricing_plans.v2.plan_buyer_can_cancel_updated')();
82
- export const onPlanArchived = EventDefinition('wix.pricing_plans.v2.plan_plan_archived')();
83
- /**
84
- * Retrieves a list of public pricing plans.
85
- *
86
- *
87
- * The `listPublicPlans()` function returns a Promise that resolves to a list of up to 100 public pricing plans. Public plans are visible plans that site visitors can see on the site and purchase.
88
- * @public
89
- * @param options - Options for filtering and paging the list of public plans.
90
- * @permissionScope Read Pricing Plans
91
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
92
- * @permissionScope Manage Orders
93
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
94
- * @permissionScope Manage Bookings Services and Settings
95
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
96
- * @permissionScope Read Orders
97
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
98
- * @permissionScope Manage Pricing Plans
99
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
100
- * @applicableIdentity APP
101
- * @applicableIdentity MEMBER
102
- * @applicableIdentity VISITOR
103
- * @returns Fulfilled - List of public pricing plans.
104
- */
105
- export function listPublicPlans(options) {
106
- var _a, _b, _c;
107
- return __awaiter(this, arguments, void 0, function* () {
108
- const requestTransformation = {
109
- limit: '$[0].limit',
110
- offset: '$[0].offset',
111
- planIds: '$[0].planIds',
112
- };
113
- const responseTransformation = '$';
114
- // @ts-ignore
115
- const { httpClient, sideEffects } = arguments[1];
116
- const { toAmbassadorRequest } = serializer({
117
- rootSchema: _listPublicPlansRequest,
118
- depSchemas: {},
119
- fqdnTransformation: {
120
- paths: [],
121
- transformation: _fromVeloEntity,
122
- },
123
- customTransformation: requestTransformation,
124
- });
125
- const { fromJSON } = serializer({
126
- rootSchema: _listPublicPlansResponse,
127
- depSchemas: {},
128
- fqdnTransformation: {
129
- paths: [],
130
- transformation: _toVeloEntity,
131
- },
132
- customTransformation: responseTransformation,
133
- });
134
- const payload = toAmbassadorRequest([options]);
135
- const reqOpts = ambassadorWixPricingPlansV2Plan.listPublicPlans(payload);
136
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
137
- try {
138
- const result = yield httpClient.request(reqOpts);
139
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
140
- return fromJSON(result.data);
141
- }
142
- catch (err) {
143
- const transformedError = sdkTransformError(err, {
144
- spreadPathsToArguments: {},
145
- explicitPathsToArguments: {
146
- limit: '$[0].limit',
147
- offset: '$[0].offset',
148
- planIds: '$[0].planIds',
149
- },
150
- singleArgumentUnchanged: false,
151
- }, ['options']);
152
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
153
- throw transformedError;
154
- }
155
- });
156
- }
157
- /**
158
- * Creates a query to retrieve a list of public pricing plans.
159
- *
160
- *
161
- * The `queryPublicPlans()` function builds a query to retrieve a list of up to 1,000 public plans and returns a [`PublicPlansQueryBuilder`](#plansquerybuilder) object.
162
- *
163
- * The returned object contains the query definition which is typically used to run the query using the [`find()`](#plansquerybuilder/find) function.
164
- *
165
- * You can refine the query by chaining `PublicPlansQueryBuilder` functions onto the query. `PublicPlansQueryBuilder` functions enable you to sort, filter, and control the results that `queryPublicPlans()` returns.
166
- *
167
- * `queryPublicPlans()` runs with the following `PublicPlansQueryBuilder` defaults that you can override:
168
- * - [`skip`](#plansquerybuilder/skip): `0`
169
- * - [`limit`](#plansquerybuilder/limit): `50`
170
- *
171
- * The functions that are chained to `queryPublicPlans()` are applied in the order they are called. For example, if you sort on the `_createdDate` property in ascending order and then on the `_id` property in ascending order, the results are sorted first by the created date of the items and then, if there are multiple results with the same date, the items are sorted by `_id` in ascending order, per created date value.
172
- *
173
- * The following `PublicPlansQueryBuilder` functions are supported for the `queryPublicPlans()` function. For a full description of the Plans object, see the object returned for the [`items`](#plansqueryresult/items) property in [`PublicPlansQueryResult`](#plansqueryresult).
174
- * @public
175
- * @permissionScope Read Pricing Plans
176
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
177
- * @permissionScope Manage Orders
178
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
179
- * @permissionScope Manage Bookings Services and Settings
180
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
181
- * @permissionScope Read Orders
182
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
183
- * @permissionScope Manage Pricing Plans
184
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
185
- * @applicableIdentity APP
186
- * @applicableIdentity MEMBER
187
- * @applicableIdentity VISITOR
188
- */
189
- export function queryPublicPlans() {
190
- const requestTransformation = { '*': '$[1]', query: '$[0]' };
191
- const responseTransformation = {
192
- items: '$.plans',
193
- pagingMetadata: '$.pagingMetadata',
194
- };
195
- // @ts-ignore
196
- const { httpClient, sideEffects } = arguments[0];
197
- const { toAmbassadorRequest } = serializer({
198
- rootSchema: _queryPublicPlansRequest,
199
- depSchemas: {},
200
- fqdnTransformation: {
201
- paths: [],
202
- transformation: _fromVeloEntity,
203
- },
204
- customTransformation: requestTransformation,
205
- });
206
- const { fromJSON } = serializer({
207
- rootSchema: _queryPublicPlansResponse,
208
- depSchemas: {},
209
- fqdnTransformation: {
210
- paths: [],
211
- transformation: _toVeloEntity,
212
- },
213
- customTransformation: responseTransformation,
214
- });
215
- return wrapWithQueryBuilder({
216
- func: (payload) => __awaiter(this, void 0, void 0, function* () {
217
- var _a, _b, _c;
218
- const reqOpts = ambassadorWixPricingPlansV2Plan.queryPublicPlans(payload);
219
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
220
- try {
221
- const result = yield httpClient.request(reqOpts);
222
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
223
- return result;
224
- }
225
- catch (err) {
226
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
227
- throw err;
228
- }
229
- }),
230
- requestTransformer: (...args) => toAmbassadorRequest(args),
231
- responseTransformer: ({ data }) => fromJSON(data),
232
- errorTransformer: (err) => {
233
- const transformedError = transformError(err, requestTransformation);
234
- throw transformedError;
235
- },
236
- pagingMethod: 'OFFSET',
237
- transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
238
- })({ cursorWithEmptyFilterAndSort: true });
239
- }
240
- /**
241
- * Retrieves a pricing plan by the specified ID.
242
- *
243
- * The `getPlan()` function returns a Promise that resolves to a plan whose ID matched the specified ID.
244
- * @param _id - Plan ID.
245
- * @public
246
- * @requiredField _id
247
- * @permissionScope Read Pricing Plans
248
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
249
- * @permissionScope Manage Pricing Plans
250
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
251
- * @applicableIdentity APP
252
- * @returns Fulfilled - The retrieved plan's information.
253
- */
254
- export function getPlan(_id) {
255
- var _a, _b, _c;
256
- return __awaiter(this, arguments, void 0, function* () {
257
- const requestTransformation = { id: '$[0]' };
258
- const responseTransformation = '$.plan';
259
- // @ts-ignore
260
- const { httpClient, sideEffects } = arguments[1];
261
- const { toAmbassadorRequest } = serializer({
262
- rootSchema: _getPlanRequest,
263
- depSchemas: {},
264
- fqdnTransformation: {
265
- paths: [],
266
- transformation: _fromVeloEntity,
267
- },
268
- customTransformation: requestTransformation,
269
- });
270
- const { fromJSON } = serializer({
271
- rootSchema: _getPlanResponse,
272
- depSchemas: {},
273
- fqdnTransformation: {
274
- paths: [...['plan']],
275
- transformation: _toVeloEntity,
276
- },
277
- customTransformation: responseTransformation,
278
- });
279
- const payload = toAmbassadorRequest([_id]);
280
- const reqOpts = ambassadorWixPricingPlansV2Plan.getPlan(payload);
281
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
282
- try {
283
- const result = yield httpClient.request(reqOpts);
284
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
285
- return fromJSON(result.data);
286
- }
287
- catch (err) {
288
- const transformedError = sdkTransformError(err, {
289
- spreadPathsToArguments: {},
290
- explicitPathsToArguments: { id: '$[0]' },
291
- singleArgumentUnchanged: false,
292
- }, ['_id']);
293
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
294
- throw transformedError;
295
- }
296
- });
297
- }
298
- /**
299
- * Retrieves a list of pricing plans.
300
- *
301
- * The `listPlans()` function returns a Promise that resolves to a list of up to 100 pricing plans. This includes public, hidden, and archived plans.
302
- * @public
303
- * @documentationMaturity preview
304
- * @param options - Options for filtering and paging the list of plans.
305
- * @permissionScope Read Pricing Plans
306
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
307
- * @permissionScope Manage Pricing Plans
308
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
309
- * @applicableIdentity APP
310
- * @returns Fulfilled - List of plans that match the given criteria.
311
- */
312
- export function listPlans(options) {
313
- var _a, _b, _c;
314
- return __awaiter(this, arguments, void 0, function* () {
315
- const requestTransformation = {
316
- archived: '$[0].archived',
317
- public: '$[0].public',
318
- limit: '$[0].limit',
319
- offset: '$[0].offset',
320
- planIds: '$[0].planIds',
321
- };
322
- const responseTransformation = '$';
323
- // @ts-ignore
324
- const { httpClient, sideEffects } = arguments[1];
325
- const { toAmbassadorRequest } = serializer({
326
- rootSchema: _listPlansRequest,
327
- depSchemas: {},
328
- fqdnTransformation: {
329
- paths: [],
330
- transformation: _fromVeloEntity,
331
- },
332
- customTransformation: requestTransformation,
333
- });
334
- const { fromJSON } = serializer({
335
- rootSchema: _listPlansResponse,
336
- depSchemas: {},
337
- fqdnTransformation: {
338
- paths: [...['Array#plans']],
339
- transformation: _toVeloEntity,
340
- },
341
- customTransformation: responseTransformation,
342
- });
343
- const payload = toAmbassadorRequest([options]);
344
- const reqOpts = ambassadorWixPricingPlansV2Plan.listPlans(payload);
345
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
346
- try {
347
- const result = yield httpClient.request(reqOpts);
348
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
349
- return fromJSON(result.data);
350
- }
351
- catch (err) {
352
- const transformedError = sdkTransformError(err, {
353
- spreadPathsToArguments: {},
354
- explicitPathsToArguments: {
355
- archived: '$[0].archived',
356
- public: '$[0].public',
357
- limit: '$[0].limit',
358
- offset: '$[0].offset',
359
- planIds: '$[0].planIds',
360
- },
361
- singleArgumentUnchanged: false,
362
- }, ['options']);
363
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
364
- throw transformedError;
365
- }
366
- });
367
- }
368
- /**
369
- * Retrieves statistics about the pricing plans.
370
- *
371
- *
372
- * The `getPlanStats()` function returns a Promise that resolves to statistics about the plan on the site.
373
- *
374
- * Currently this function provides only the total number of pricing plans, including archived plans.
375
- * @public
376
- * @permissionScope Read Pricing Plans
377
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
378
- * @permissionScope Manage Pricing Plans
379
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
380
- * @applicableIdentity APP
381
- * @returns Fulfilled - Overall statistics about the pricing plans.
382
- */
383
- export function getPlanStats() {
384
- var _a, _b, _c;
385
- return __awaiter(this, arguments, void 0, function* () {
386
- const requestTransformation = {};
387
- const responseTransformation = '$';
388
- // @ts-ignore
389
- const { httpClient, sideEffects } = arguments[0];
390
- const { toAmbassadorRequest } = serializer({
391
- rootSchema: _getPlanStatsRequest,
392
- depSchemas: {},
393
- fqdnTransformation: {
394
- paths: [],
395
- transformation: _fromVeloEntity,
396
- },
397
- customTransformation: requestTransformation,
398
- });
399
- const { fromJSON } = serializer({
400
- rootSchema: _getPlanStatsResponse,
401
- depSchemas: {},
402
- fqdnTransformation: {
403
- paths: [],
404
- transformation: _toVeloEntity,
405
- },
406
- customTransformation: responseTransformation,
407
- });
408
- const payload = toAmbassadorRequest([]);
409
- const reqOpts = ambassadorWixPricingPlansV2Plan.getPlanStats(payload);
410
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
411
- try {
412
- const result = yield httpClient.request(reqOpts);
413
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
414
- return fromJSON(result.data);
415
- }
416
- catch (err) {
417
- const transformedError = sdkTransformError(err, {
418
- spreadPathsToArguments: {},
419
- explicitPathsToArguments: {},
420
- singleArgumentUnchanged: false,
421
- }, []);
422
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
423
- throw transformedError;
424
- }
425
- });
426
- }
427
- /**
428
- * Creates a pricing plan.
429
- *
430
- *
431
- * The `createPlan()` function returns a Promise that resolves to a newly-created pricing plan after is has successfully been created.
432
- *
433
- * The passed `plan` object must contain a [pricing model](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/pricing-models). A pricing model can be one of the following:
434
- * - **A subscription**: A subscription with recurring payment and how often the plan occurs. Subscriptions can have free trial days.
435
- * - **A plan that does not renew**: A single payment for a specific duration that doesn't renew.
436
- * - **An unlimited plan**: A single payment for an unlimited amount of time (until canceled).
437
- *
438
- * Pricing plans created by this function are available to the site owner in the Pricing Plans section in the Dashboard.
439
- * @public
440
- * @requiredField plan
441
- * @requiredField plan.name
442
- * @requiredField plan.pricing
443
- * @requiredField plan.pricing.singlePaymentForDuration.count
444
- * @requiredField plan.pricing.subscription.cycleCount
445
- * @requiredField plan.pricing.subscription.cycleDuration
446
- * @requiredField plan.pricing.subscription.cycleDuration.count
447
- * @param plan - Information for the plan being created.
448
- * @permissionScope Manage Pricing Plans
449
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
450
- * @applicableIdentity APP
451
- * @returns Fulfilled - The created plan.
452
- *
453
- * Rejected - Error message.
454
- */
455
- export function createPlan(plan) {
456
- var _a, _b, _c;
457
- return __awaiter(this, arguments, void 0, function* () {
458
- const requestTransformation = { plan: '$[0]' };
459
- const responseTransformation = '$.plan';
460
- // @ts-ignore
461
- const { httpClient, sideEffects } = arguments[1];
462
- const { toAmbassadorRequest } = serializer({
463
- rootSchema: _createPlanRequest,
464
- depSchemas: {},
465
- fqdnTransformation: {
466
- paths: [...['plan']],
467
- transformation: _fromVeloEntity,
468
- },
469
- customTransformation: requestTransformation,
470
- });
471
- const { fromJSON } = serializer({
472
- rootSchema: _createPlanResponse,
473
- depSchemas: {},
474
- fqdnTransformation: {
475
- paths: [...['plan']],
476
- transformation: _toVeloEntity,
477
- },
478
- customTransformation: responseTransformation,
479
- });
480
- const payload = toAmbassadorRequest([plan]);
481
- const reqOpts = ambassadorWixPricingPlansV2Plan.createPlan(payload);
482
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
483
- try {
484
- const result = yield httpClient.request(reqOpts);
485
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
486
- return fromJSON(result.data);
487
- }
488
- catch (err) {
489
- const transformedError = sdkTransformError(err, {
490
- spreadPathsToArguments: {},
491
- explicitPathsToArguments: { plan: '$[0]' },
492
- singleArgumentUnchanged: false,
493
- }, ['plan']);
494
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
495
- throw transformedError;
496
- }
497
- });
498
- }
499
- /**
500
- * Updates a pricing plan.
501
- *
502
- *
503
- * The `updatePlan()` function returns a Promise that resolves to an updated plan.
504
- *
505
- * Updating a plan does not impact existing purchases made for the plan. All purchases keep the details of the original plan that was active at the time of the purchase.
506
- * @public
507
- * @requiredField _id
508
- * @requiredField plan
509
- * @param _id - ID of the plan to update.
510
- * @param options - Options for updating the plan.
511
- * @permissionScope Manage Pricing Plans
512
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
513
- * @applicableIdentity APP
514
- * @returns Fulfilled - The updated plan.
515
- *
516
- * Rejected - Error message.
517
- */
518
- export function updatePlan(_id, plan) {
519
- var _a, _b, _c;
520
- return __awaiter(this, arguments, void 0, function* () {
521
- const requestTransformation = { plan: { '*': '$[1]', id: '$[0]' } };
522
- const responseTransformation = '$.plan';
523
- // @ts-ignore
524
- const { httpClient, sideEffects } = arguments[2];
525
- const { toAmbassadorRequest } = serializer({
526
- rootSchema: _updatePlanRequest,
527
- depSchemas: {},
528
- fqdnTransformation: {
529
- paths: [...['plan']],
530
- transformation: _fromVeloEntity,
531
- },
532
- customTransformation: requestTransformation,
533
- });
534
- const { fromJSON } = serializer({
535
- rootSchema: _updatePlanResponse,
536
- depSchemas: {},
537
- fqdnTransformation: {
538
- paths: [...['plan']],
539
- transformation: _toVeloEntity,
540
- },
541
- customTransformation: responseTransformation,
542
- });
543
- const payload = toAmbassadorRequest([_id, plan]);
544
- const reqOpts = ambassadorWixPricingPlansV2Plan.updatePlan(payload);
545
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
546
- try {
547
- const result = yield httpClient.request(reqOpts);
548
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
549
- return fromJSON(result.data);
550
- }
551
- catch (err) {
552
- const transformedError = sdkTransformError(err, {
553
- spreadPathsToArguments: { plan: '$[1]' },
554
- explicitPathsToArguments: { 'plan.id': '$[0]' },
555
- singleArgumentUnchanged: false,
556
- }, ['_id', 'plan']);
557
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
558
- throw transformedError;
559
- }
560
- });
561
- }
562
- /**
563
- * Sets visibility for non-archived pricing plans.
564
- *
565
- * The `setPlanVisibility()` functions returns a Promise that resolves to a pricing plan when its visibility has successfully been set.
566
- *
567
- * By default, pricing plans are public, meaning they are visible. [Plans can be hidden](https://support.wix.com/en/article/pricing-plans-removing-a-plan-from-your-site#hiding-plans) so that site members and visitors cannot see or choose them.
568
- *
569
- * As opposed to archiving, setting visibility can be reversed. This means that a public plan can be hidden, and a hidden plan can be made public (visible).
570
- *
571
- * >**Note:** An archived plan always remains archived and cannot be made active again. When archiving a plan, its `public` property is automatically set to `false` so that it is hidden.
572
- *
573
- * Changing a plan's visibility does not impact existing orders for the plan. All orders for hidden plans are still active and keep their terms and payment options.
574
- * @param visible - Whether to set the plan as visible.
575
- * @public
576
- * @requiredField _id
577
- * @requiredField visible
578
- * @param _id - The ID of the plan to either display or hide on the site page.
579
- * @param options - Plan visibility options.
580
- * @permissionScope Manage Pricing Plans
581
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
582
- * @applicableIdentity APP
583
- * @returns Fulfilled - The plan's information.
584
- *
585
- * Rejected - Error message.
586
- */
587
- export function setPlanVisibility(_id, visible) {
588
- var _a, _b, _c;
589
- return __awaiter(this, arguments, void 0, function* () {
590
- const requestTransformation = { id: '$[0]', visible: '$[1]' };
591
- const responseTransformation = '$';
592
- // @ts-ignore
593
- const { httpClient, sideEffects } = arguments[2];
594
- const { toAmbassadorRequest } = serializer({
595
- rootSchema: _setPlanVisibilityRequest,
596
- depSchemas: {},
597
- fqdnTransformation: {
598
- paths: [],
599
- transformation: _fromVeloEntity,
600
- },
601
- customTransformation: requestTransformation,
602
- });
603
- const { fromJSON } = serializer({
604
- rootSchema: _setPlanVisibilityResponse,
605
- depSchemas: {},
606
- fqdnTransformation: {
607
- paths: [...['plan']],
608
- transformation: _toVeloEntity,
609
- },
610
- customTransformation: responseTransformation,
611
- });
612
- const payload = toAmbassadorRequest([_id, visible]);
613
- const reqOpts = ambassadorWixPricingPlansV2Plan.setPlanVisibility(payload);
614
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
615
- try {
616
- const result = yield httpClient.request(reqOpts);
617
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
618
- return fromJSON(result.data);
619
- }
620
- catch (err) {
621
- const transformedError = sdkTransformError(err, {
622
- spreadPathsToArguments: {},
623
- explicitPathsToArguments: { id: '$[0]', visible: '$[1]' },
624
- singleArgumentUnchanged: false,
625
- }, ['_id', 'visible']);
626
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
627
- throw transformedError;
628
- }
629
- });
630
- }
631
- /**
632
- * Marks a pricing plan as the primary pricing plan.
633
- *
634
- *
635
- * The `makePlanPrimary()` function returns a Promise that resolves to the now primary pricing plan.
636
- *
637
- * Only a single plan can be marked as a primary plan at any given time. If there is an existing plan marked as primary, calling `makePlanPrimary()` causes the existing primary plan to lose its primary status.
638
- *
639
- * When viewing pricing plans on the site, the primary plan is highlighted with a customizable ribbon.
640
- * @public
641
- * @requiredField _id
642
- * @param _id - ID of the pricing plan to set as the primary plan.
643
- * @permissionScope Manage Pricing Plans
644
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
645
- * @applicableIdentity APP
646
- * @returns Fulfilled - The primary plan.
647
- */
648
- export function makePlanPrimary(_id) {
649
- var _a, _b, _c;
650
- return __awaiter(this, arguments, void 0, function* () {
651
- const requestTransformation = { id: '$[0]' };
652
- const responseTransformation = '$';
653
- // @ts-ignore
654
- const { httpClient, sideEffects } = arguments[1];
655
- const { toAmbassadorRequest } = serializer({
656
- rootSchema: _makePlanPrimaryRequest,
657
- depSchemas: {},
658
- fqdnTransformation: {
659
- paths: [],
660
- transformation: _fromVeloEntity,
661
- },
662
- customTransformation: requestTransformation,
663
- });
664
- const { fromJSON } = serializer({
665
- rootSchema: _makePlanPrimaryResponse,
666
- depSchemas: {},
667
- fqdnTransformation: {
668
- paths: [...['plan']],
669
- transformation: _toVeloEntity,
670
- },
671
- customTransformation: responseTransformation,
672
- });
673
- const payload = toAmbassadorRequest([_id]);
674
- const reqOpts = ambassadorWixPricingPlansV2Plan.makePlanPrimary(payload);
675
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
676
- try {
677
- const result = yield httpClient.request(reqOpts);
678
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
679
- return fromJSON(result.data);
680
- }
681
- catch (err) {
682
- const transformedError = sdkTransformError(err, {
683
- spreadPathsToArguments: {},
684
- explicitPathsToArguments: { id: '$[0]' },
685
- singleArgumentUnchanged: false,
686
- }, ['_id']);
687
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
688
- throw transformedError;
689
- }
690
- });
691
- }
692
- /**
693
- * Sets all pricing plans to no longer be primary.
694
- *
695
- * The `clearPrimary()` function returns a Promise that is resolved when there are no pricing plans marked as `primary`.
696
- *
697
- * After clearing the primary plan, when viewing pricing plans on the site, no plan is highlighted with a customizable ribbon.
698
- * @public
699
- * @permissionScope Manage Pricing Plans
700
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
701
- * @applicableIdentity APP
702
- */
703
- export function clearPrimary() {
704
- var _a, _b, _c;
705
- return __awaiter(this, arguments, void 0, function* () {
706
- const requestTransformation = {};
707
- const responseTransformation = '$';
708
- // @ts-ignore
709
- const { httpClient, sideEffects } = arguments[0];
710
- const { toAmbassadorRequest } = serializer({
711
- rootSchema: _clearPrimaryRequest,
712
- depSchemas: {},
713
- fqdnTransformation: {
714
- paths: [],
715
- transformation: _fromVeloEntity,
716
- },
717
- customTransformation: requestTransformation,
718
- });
719
- const { fromJSON } = serializer({
720
- rootSchema: _clearPrimaryResponse,
721
- depSchemas: {},
722
- fqdnTransformation: {
723
- paths: [],
724
- transformation: _toVeloEntity,
725
- },
726
- customTransformation: responseTransformation,
727
- });
728
- const payload = toAmbassadorRequest([]);
729
- const reqOpts = ambassadorWixPricingPlansV2Plan.clearPrimary(payload);
730
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
731
- try {
732
- const result = yield httpClient.request(reqOpts);
733
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
734
- }
735
- catch (err) {
736
- const transformedError = sdkTransformError(err, {
737
- spreadPathsToArguments: {},
738
- explicitPathsToArguments: {},
739
- singleArgumentUnchanged: false,
740
- }, []);
741
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
742
- throw transformedError;
743
- }
744
- });
745
- }
746
- /**
747
- * Archives a single plan.
748
- *
749
- *
750
- * The `archivePlan()` function returns a Promise that resolves to the newly-archived plan.
751
- *
752
- * When a plan is archived, the plan
753
- * - Is no longer available for display or selection by visitors. This is because the plan's `public` property is automatically set to `false`.
754
- * - Cannot be purchased.
755
- * - Cannot be "un-archived", meaning the plan cannot be made active again.
756
- *
757
- * Plan archiving does not impact existing purchases made for the plan. All purchases for the plan are still active and keep their payment options and terms.
758
- *
759
- * Site owners can see archived plans in the Dashboard under **Pricing Plans -> Archived Plans**.
760
- *
761
- * >**Note:** An attempt to archive an already-archived plan throws an error.
762
- * @public
763
- * @requiredField _id
764
- * @param _id - ID of the active plan to archive.
765
- * @permissionScope Manage Pricing Plans
766
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
767
- * @applicableIdentity APP
768
- * @returns Fulfilled - The archived plan.
769
- *
770
- * Rejected - Error message.
771
- */
772
- export function archivePlan(_id) {
773
- var _a, _b, _c;
774
- return __awaiter(this, arguments, void 0, function* () {
775
- const requestTransformation = { id: '$[0]' };
776
- const responseTransformation = '$';
777
- // @ts-ignore
778
- const { httpClient, sideEffects } = arguments[1];
779
- const { toAmbassadorRequest } = serializer({
780
- rootSchema: _archivePlanRequest,
781
- depSchemas: {},
782
- fqdnTransformation: {
783
- paths: [],
784
- transformation: _fromVeloEntity,
785
- },
786
- customTransformation: requestTransformation,
787
- });
788
- const { fromJSON } = serializer({
789
- rootSchema: _archivePlanResponse,
790
- depSchemas: {},
791
- fqdnTransformation: {
792
- paths: [...['plan']],
793
- transformation: _toVeloEntity,
794
- },
795
- customTransformation: responseTransformation,
796
- });
797
- const payload = toAmbassadorRequest([_id]);
798
- const reqOpts = ambassadorWixPricingPlansV2Plan.archivePlan(payload);
799
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
800
- try {
801
- const result = yield httpClient.request(reqOpts);
802
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
803
- return fromJSON(result.data);
804
- }
805
- catch (err) {
806
- const transformedError = sdkTransformError(err, {
807
- spreadPathsToArguments: {},
808
- explicitPathsToArguments: { id: '$[0]' },
809
- singleArgumentUnchanged: false,
810
- }, ['_id']);
811
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
812
- throw transformedError;
813
- }
814
- });
815
- }
816
- /**
817
- * Changes the display order of the pricing plans on the site page and in the Dashboard.
818
- *
819
- *
820
- * The `arrangePlans()` function returns a Promise that resolves when the plans are rearranged on the site page and in the Dashboard.
821
- *
822
- * To rearrange the order of the plans, provide a list of the IDs for all non-archived plans in the desired order, including hidden plans.
823
- *
824
- * >**Note:** Make sure to provide *all* non-archived plan IDs to avoid unpredictable results.
825
- * @param ids - IDs of all non-archived plans in the order you want them arranged.
826
- * @public
827
- * @requiredField ids
828
- * @permissionScope Manage Pricing Plans
829
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
830
- * @applicableIdentity APP
831
- */
832
- export function arrangePlans(ids) {
833
- var _a, _b, _c;
834
- return __awaiter(this, arguments, void 0, function* () {
835
- const requestTransformation = { ids: '$[0]' };
836
- const responseTransformation = '$';
837
- // @ts-ignore
838
- const { httpClient, sideEffects } = arguments[1];
839
- const { toAmbassadorRequest } = serializer({
840
- rootSchema: _arrangePlansRequest,
841
- depSchemas: {},
842
- fqdnTransformation: {
843
- paths: [],
844
- transformation: _fromVeloEntity,
845
- },
846
- customTransformation: requestTransformation,
847
- });
848
- const { fromJSON } = serializer({
849
- rootSchema: _arrangePlansResponse,
850
- depSchemas: {},
851
- fqdnTransformation: {
852
- paths: [],
853
- transformation: _toVeloEntity,
854
- },
855
- customTransformation: responseTransformation,
856
- });
857
- const payload = toAmbassadorRequest([ids]);
858
- const reqOpts = ambassadorWixPricingPlansV2Plan.arrangePlans(payload);
859
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
860
- try {
861
- const result = yield httpClient.request(reqOpts);
862
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
863
- }
864
- catch (err) {
865
- const transformedError = sdkTransformError(err, {
866
- spreadPathsToArguments: {},
867
- explicitPathsToArguments: { ids: '$[0]' },
868
- singleArgumentUnchanged: false,
869
- }, ['ids']);
870
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
871
- throw transformedError;
872
- }
873
- });
874
- }
875
- //# sourceMappingURL=pricing-plans-v2-plan.universal.js.map