@wix/auto_sdk_packages_packages 1.0.2 → 1.0.4

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 (119) hide show
  1. package/build/cjs/index.d.ts +273 -1
  2. package/build/cjs/index.js +953 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/meta.d.ts +542 -1
  5. package/build/cjs/meta.js +574 -15
  6. package/build/cjs/meta.js.map +1 -1
  7. package/build/cjs/{src/premium-reseller-v1-packages-packages.types.d.ts → premium-reseller-v1-packages-packages.universal-CeJKqN8_.d.ts} +321 -199
  8. package/build/{internal/cjs/src/premium-reseller-v1-packages-packages.public.d.ts → es/index.d.mts} +36 -25
  9. package/build/es/index.mjs +906 -0
  10. package/build/es/index.mjs.map +1 -0
  11. package/build/es/meta.d.mts +542 -0
  12. package/build/es/meta.mjs +541 -0
  13. package/build/es/meta.mjs.map +1 -0
  14. package/build/{internal/cjs/src/premium-reseller-v1-packages-packages.types.d.ts → es/premium-reseller-v1-packages-packages.universal-CeJKqN8_.d.mts} +321 -199
  15. package/build/internal/cjs/index.d.ts +273 -1
  16. package/build/internal/cjs/index.js +953 -15
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/meta.d.ts +542 -1
  19. package/build/internal/cjs/meta.js +574 -15
  20. package/build/internal/cjs/meta.js.map +1 -1
  21. package/build/internal/{es/src/premium-reseller-v1-packages-packages.types.d.ts → cjs/premium-reseller-v1-packages-packages.universal-CeJKqN8_.d.ts} +321 -199
  22. package/build/{es/src/premium-reseller-v1-packages-packages.public.d.ts → internal/es/index.d.mts} +36 -25
  23. package/build/internal/es/index.mjs +906 -0
  24. package/build/internal/es/index.mjs.map +1 -0
  25. package/build/internal/es/meta.d.mts +542 -0
  26. package/build/internal/es/meta.mjs +541 -0
  27. package/build/internal/es/meta.mjs.map +1 -0
  28. package/build/{es/src/premium-reseller-v1-packages-packages.types.d.ts → internal/es/premium-reseller-v1-packages-packages.universal-CeJKqN8_.d.mts} +321 -199
  29. package/package.json +11 -10
  30. package/build/cjs/index.typings.d.ts +0 -1
  31. package/build/cjs/index.typings.js +0 -18
  32. package/build/cjs/index.typings.js.map +0 -1
  33. package/build/cjs/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
  34. package/build/cjs/src/premium-reseller-v1-packages-packages.context.js +0 -34
  35. package/build/cjs/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
  36. package/build/cjs/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
  37. package/build/cjs/src/premium-reseller-v1-packages-packages.http.js +0 -563
  38. package/build/cjs/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
  39. package/build/cjs/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
  40. package/build/cjs/src/premium-reseller-v1-packages-packages.meta.js +0 -218
  41. package/build/cjs/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
  42. package/build/cjs/src/premium-reseller-v1-packages-packages.public.d.ts +0 -262
  43. package/build/cjs/src/premium-reseller-v1-packages-packages.public.js +0 -84
  44. package/build/cjs/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
  45. package/build/cjs/src/premium-reseller-v1-packages-packages.types.js +0 -155
  46. package/build/cjs/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
  47. package/build/cjs/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1865
  48. package/build/cjs/src/premium-reseller-v1-packages-packages.universal.js +0 -756
  49. package/build/cjs/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
  50. package/build/es/index.d.ts +0 -1
  51. package/build/es/index.js +0 -2
  52. package/build/es/index.js.map +0 -1
  53. package/build/es/index.typings.d.ts +0 -1
  54. package/build/es/index.typings.js +0 -2
  55. package/build/es/index.typings.js.map +0 -1
  56. package/build/es/meta.d.ts +0 -1
  57. package/build/es/meta.js +0 -2
  58. package/build/es/meta.js.map +0 -1
  59. package/build/es/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
  60. package/build/es/src/premium-reseller-v1-packages-packages.context.js +0 -14
  61. package/build/es/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
  62. package/build/es/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
  63. package/build/es/src/premium-reseller-v1-packages-packages.http.js +0 -550
  64. package/build/es/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
  65. package/build/es/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
  66. package/build/es/src/premium-reseller-v1-packages-packages.meta.js +0 -182
  67. package/build/es/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
  68. package/build/es/src/premium-reseller-v1-packages-packages.public.js +0 -54
  69. package/build/es/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
  70. package/build/es/src/premium-reseller-v1-packages-packages.types.js +0 -152
  71. package/build/es/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
  72. package/build/es/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1865
  73. package/build/es/src/premium-reseller-v1-packages-packages.universal.js +0 -720
  74. package/build/es/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
  75. package/build/internal/cjs/index.typings.d.ts +0 -1
  76. package/build/internal/cjs/index.typings.js +0 -18
  77. package/build/internal/cjs/index.typings.js.map +0 -1
  78. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
  79. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.context.js +0 -34
  80. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
  81. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
  82. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.js +0 -563
  83. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
  84. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
  85. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.js +0 -218
  86. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
  87. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.public.js +0 -84
  88. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
  89. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.types.js +0 -155
  90. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
  91. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1865
  92. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.universal.js +0 -756
  93. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
  94. package/build/internal/es/index.d.ts +0 -1
  95. package/build/internal/es/index.js +0 -2
  96. package/build/internal/es/index.js.map +0 -1
  97. package/build/internal/es/index.typings.d.ts +0 -1
  98. package/build/internal/es/index.typings.js +0 -2
  99. package/build/internal/es/index.typings.js.map +0 -1
  100. package/build/internal/es/meta.d.ts +0 -1
  101. package/build/internal/es/meta.js +0 -2
  102. package/build/internal/es/meta.js.map +0 -1
  103. package/build/internal/es/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
  104. package/build/internal/es/src/premium-reseller-v1-packages-packages.context.js +0 -14
  105. package/build/internal/es/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
  106. package/build/internal/es/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
  107. package/build/internal/es/src/premium-reseller-v1-packages-packages.http.js +0 -550
  108. package/build/internal/es/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
  109. package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
  110. package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.js +0 -182
  111. package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
  112. package/build/internal/es/src/premium-reseller-v1-packages-packages.public.d.ts +0 -262
  113. package/build/internal/es/src/premium-reseller-v1-packages-packages.public.js +0 -54
  114. package/build/internal/es/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
  115. package/build/internal/es/src/premium-reseller-v1-packages-packages.types.js +0 -152
  116. package/build/internal/es/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
  117. package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1865
  118. package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.js +0 -720
  119. package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
@@ -1,756 +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
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.updatePackageExternalId = exports.adjustProductInstanceSpecifications = exports.cancelProductInstance = exports.unassignProductInstanceFromSite = exports.assignProductInstanceToSite = exports.queryPackages = exports.getPackage = exports.cancelPackage = exports.createPackageV2 = exports.createPackage = exports.WebhookIdentityType = exports.FieldToUpdate = exports.ProductAdjustment = exports.PriceIncreaseTrigger = exports.ContractSwitchReason = exports.ContractSwitchType = exports.UnassignReason = exports.Initiator = exports.ReactivationReasonEnum = exports.SubscriptionStatus = exports.IntervalUnit = exports.ProviderName = exports.SortOrder = exports.Status = exports.CycleDescriptorType = exports.IntervalIntervalUnit = exports.FailureReasonFailureReason = void 0;
27
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
- const query_builder_1 = require("@wix/sdk-runtime/query-builder");
29
- const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
30
- const ambassadorWixPremiumResellerV1Packages = __importStar(require("./premium-reseller-v1-packages-packages.http.js"));
31
- var FailureReasonFailureReason;
32
- (function (FailureReasonFailureReason) {
33
- FailureReasonFailureReason["UNKNOWN"] = "UNKNOWN";
34
- /** The product instance couldn't be created because the Resellers API timed out. */
35
- FailureReasonFailureReason["DELIVERY_TIMEOUT"] = "DELIVERY_TIMEOUT";
36
- /** The product instance couldn't be created because an external process failed. */
37
- FailureReasonFailureReason["EXTERNAL_FAILURE"] = "EXTERNAL_FAILURE";
38
- })(FailureReasonFailureReason || (exports.FailureReasonFailureReason = FailureReasonFailureReason = {}));
39
- var IntervalIntervalUnit;
40
- (function (IntervalIntervalUnit) {
41
- /** unknown interval unit */
42
- IntervalIntervalUnit["UNKNOWN"] = "UNKNOWN";
43
- /** Day */
44
- IntervalIntervalUnit["DAY"] = "DAY";
45
- /** Week */
46
- IntervalIntervalUnit["WEEK"] = "WEEK";
47
- /** Month */
48
- IntervalIntervalUnit["MONTH"] = "MONTH";
49
- /** Year */
50
- IntervalIntervalUnit["YEAR"] = "YEAR";
51
- })(IntervalIntervalUnit || (exports.IntervalIntervalUnit = IntervalIntervalUnit = {}));
52
- var CycleDescriptorType;
53
- (function (CycleDescriptorType) {
54
- /** The payment type hasn't been set. */
55
- CycleDescriptorType["UNKNOWN"] = "UNKNOWN";
56
- /** The reseller pays Wix in a single payment. */
57
- CycleDescriptorType["ONE_TIME"] = "ONE_TIME";
58
- /** The reseller pays Wix on a recurring schedule. */
59
- CycleDescriptorType["RECURRING"] = "RECURRING";
60
- })(CycleDescriptorType || (exports.CycleDescriptorType = CycleDescriptorType = {}));
61
- var Status;
62
- (function (Status) {
63
- /** The product instance isn't yet available to the customer. */
64
- Status["PENDING"] = "PENDING";
65
- /** The customer can use the product instance. */
66
- Status["ENABLED"] = "ENABLED";
67
- /** The product instance isn't any longer available to the customer. */
68
- Status["CANCELED"] = "CANCELED";
69
- /** The product instance couldn't be delivered successfully and has never been available to the customer. */
70
- Status["FAILED"] = "FAILED";
71
- /** The product instance isn't yet available to the customer, because an external provider or the customer must take an action. */
72
- Status["AWAITING_ACTION"] = "AWAITING_ACTION";
73
- })(Status || (exports.Status = Status = {}));
74
- var SortOrder;
75
- (function (SortOrder) {
76
- SortOrder["ASC"] = "ASC";
77
- SortOrder["DESC"] = "DESC";
78
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
79
- var ProviderName;
80
- (function (ProviderName) {
81
- ProviderName["UNKNOWN"] = "UNKNOWN";
82
- ProviderName["SBS"] = "SBS";
83
- ProviderName["LICENSER"] = "LICENSER";
84
- ProviderName["BASS"] = "BASS";
85
- ProviderName["RESELLER"] = "RESELLER";
86
- ProviderName["RECURRING_INVOICES"] = "RECURRING_INVOICES";
87
- })(ProviderName || (exports.ProviderName = ProviderName = {}));
88
- var IntervalUnit;
89
- (function (IntervalUnit) {
90
- /** unknown interval unit */
91
- IntervalUnit["UNKNOWN"] = "UNKNOWN";
92
- /** day */
93
- IntervalUnit["DAY"] = "DAY";
94
- /** week */
95
- IntervalUnit["WEEK"] = "WEEK";
96
- /** month */
97
- IntervalUnit["MONTH"] = "MONTH";
98
- /** year */
99
- IntervalUnit["YEAR"] = "YEAR";
100
- })(IntervalUnit || (exports.IntervalUnit = IntervalUnit = {}));
101
- var SubscriptionStatus;
102
- (function (SubscriptionStatus) {
103
- SubscriptionStatus["UNKNOWN"] = "UNKNOWN";
104
- SubscriptionStatus["AUTO_RENEW_ON"] = "AUTO_RENEW_ON";
105
- SubscriptionStatus["AUTO_RENEW_OFF"] = "AUTO_RENEW_OFF";
106
- SubscriptionStatus["MANUAL_RECURRING"] = "MANUAL_RECURRING";
107
- SubscriptionStatus["CANCELLED"] = "CANCELLED";
108
- SubscriptionStatus["TRANSFERRED"] = "TRANSFERRED";
109
- })(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
110
- /** Reason for subscription reactivation */
111
- var ReactivationReasonEnum;
112
- (function (ReactivationReasonEnum) {
113
- ReactivationReasonEnum["UNKNOWN"] = "UNKNOWN";
114
- /**
115
- * Subscription was reactivated due to billing status change from CANCELED to ACTIVE, for example if it was incorrectly
116
- * canceled because of suspicion of fraud
117
- */
118
- ReactivationReasonEnum["BILLING_STATUS_CHANGE"] = "BILLING_STATUS_CHANGE";
119
- /** Subscription was reactivated after a chargeback dispute */
120
- ReactivationReasonEnum["REACTIVATED_AFTER_CHARGEBACK"] = "REACTIVATED_AFTER_CHARGEBACK";
121
- })(ReactivationReasonEnum || (exports.ReactivationReasonEnum = ReactivationReasonEnum = {}));
122
- var Initiator;
123
- (function (Initiator) {
124
- Initiator["UNKNOWN"] = "UNKNOWN";
125
- Initiator["USER_REQUESTED"] = "USER_REQUESTED";
126
- Initiator["APP_MANAGED"] = "APP_MANAGED";
127
- Initiator["PASSIVE"] = "PASSIVE";
128
- })(Initiator || (exports.Initiator = Initiator = {}));
129
- var UnassignReason;
130
- (function (UnassignReason) {
131
- UnassignReason["UNKNOWN"] = "UNKNOWN";
132
- UnassignReason["USER_REQUESTED"] = "USER_REQUESTED";
133
- UnassignReason["REPLACED_BY_ANOTHER_SUBSCRIPTION"] = "REPLACED_BY_ANOTHER_SUBSCRIPTION";
134
- })(UnassignReason || (exports.UnassignReason = UnassignReason = {}));
135
- /** Copied from SBS */
136
- var ContractSwitchType;
137
- (function (ContractSwitchType) {
138
- ContractSwitchType["NOT_APPLICABLE"] = "NOT_APPLICABLE";
139
- ContractSwitchType["ADDITIONAL_QUANTITY"] = "ADDITIONAL_QUANTITY";
140
- ContractSwitchType["CREDIT_UNUSED_PERIOD"] = "CREDIT_UNUSED_PERIOD";
141
- ContractSwitchType["REFUND_PRICE_DIFF"] = "REFUND_PRICE_DIFF";
142
- ContractSwitchType["ADJUST_PERIOD_END"] = "ADJUST_PERIOD_END";
143
- ContractSwitchType["DOWNGRADE_GRACE_PERIOD"] = "DOWNGRADE_GRACE_PERIOD";
144
- ContractSwitchType["FULL_AMOUNT_PERIOD"] = "FULL_AMOUNT_PERIOD";
145
- ContractSwitchType["END_OF_PERIOD"] = "END_OF_PERIOD";
146
- ContractSwitchType["PENDING_CHANGES"] = "PENDING_CHANGES";
147
- ContractSwitchType["DOWNGRADE_RENEWAL"] = "DOWNGRADE_RENEWAL";
148
- })(ContractSwitchType || (exports.ContractSwitchType = ContractSwitchType = {}));
149
- var ContractSwitchReason;
150
- (function (ContractSwitchReason) {
151
- ContractSwitchReason["EXTERNAL_PROVIDER_TRIGGER"] = "EXTERNAL_PROVIDER_TRIGGER";
152
- ContractSwitchReason["PRICE_INCREASE"] = "PRICE_INCREASE";
153
- })(ContractSwitchReason || (exports.ContractSwitchReason = ContractSwitchReason = {}));
154
- /** Reason for Price Increase Trigger */
155
- var PriceIncreaseTrigger;
156
- (function (PriceIncreaseTrigger) {
157
- PriceIncreaseTrigger["NEAR_RENEWAL"] = "NEAR_RENEWAL";
158
- PriceIncreaseTrigger["RECURRING_SUCCESS"] = "RECURRING_SUCCESS";
159
- PriceIncreaseTrigger["MANUAL"] = "MANUAL";
160
- })(PriceIncreaseTrigger || (exports.PriceIncreaseTrigger = PriceIncreaseTrigger = {}));
161
- /** Triggered when a subscription's product is adusted. */
162
- var ProductAdjustment;
163
- (function (ProductAdjustment) {
164
- /** flag to show that the ContractSwitchedEvent is not applicable / needed */
165
- ProductAdjustment["NOT_APPLICABLE"] = "NOT_APPLICABLE";
166
- /** flag to show that the ContractSwitchedEvent is a Downgrade */
167
- ProductAdjustment["DOWNGRADE"] = "DOWNGRADE";
168
- })(ProductAdjustment || (exports.ProductAdjustment = ProductAdjustment = {}));
169
- var FieldToUpdate;
170
- (function (FieldToUpdate) {
171
- FieldToUpdate["STATUS"] = "STATUS";
172
- FieldToUpdate["COUNTRY_CODE"] = "COUNTRY_CODE";
173
- })(FieldToUpdate || (exports.FieldToUpdate = FieldToUpdate = {}));
174
- var WebhookIdentityType;
175
- (function (WebhookIdentityType) {
176
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
177
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
178
- WebhookIdentityType["MEMBER"] = "MEMBER";
179
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
180
- WebhookIdentityType["APP"] = "APP";
181
- })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
182
- /**
183
- * Creates a new package.
184
- *
185
- * Deprecated: This method is deprecated and will be removed by 2024-12-31.
186
- * Use com.wixpress.premium.reseller.packages.v1.Packages.CreatePackageV2 instead.
187
- *
188
- * HTTP Request:
189
- * POST /v1/packages
190
- *
191
- * Permissions:
192
- * Requires the "premium.reseller-package.manage" permission with MANUAL type.
193
- *
194
- * Event:
195
- * A PRIVATE callback will be triggered when the package is successfully created.
196
- *
197
- * Required Fields:
198
- * - CreatePackageRequest.products
199
- *
200
- * Maturity: BETA
201
- * Exposure: PUBLIC
202
- * @public
203
- * @documentationMaturity preview
204
- * @requiredField options.products
205
- * @permissionId premium.reseller-package.manage
206
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.CreatePackage
207
- * @deprecated
208
- * @replacedBy com.wixpress.premium.reseller.packages.v1.Packages.CreatePackageV2
209
- * @targetRemovalDate 2024-12-31
210
- */
211
- async function createPackage(options) {
212
- // @ts-ignore
213
- const { httpClient, sideEffects } = arguments[1];
214
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
215
- idempotencyKey: options?.idempotencyKey,
216
- externalId: options?.externalId,
217
- products: options?.products,
218
- });
219
- const reqOpts = ambassadorWixPremiumResellerV1Packages.createPackage(payload);
220
- sideEffects?.onSiteCall?.();
221
- try {
222
- const result = await httpClient.request(reqOpts);
223
- sideEffects?.onSuccess?.(result);
224
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
225
- }
226
- catch (err) {
227
- const transformedError = (0, transform_error_1.transformError)(err, {
228
- spreadPathsToArguments: {},
229
- explicitPathsToArguments: {
230
- idempotencyKey: '$[0].idempotencyKey',
231
- externalId: '$[0].externalId',
232
- products: '$[0].products',
233
- },
234
- singleArgumentUnchanged: false,
235
- }, ['options']);
236
- sideEffects?.onError?.(err);
237
- throw transformedError;
238
- }
239
- }
240
- exports.createPackage = createPackage;
241
- /**
242
- * Creates a package of product instances.
243
- *
244
- *
245
- * You must pass the relevant Wix account ID in the header of the call. In
246
- * the DIY flow, we recommend to pass the customer's sub-account ID instead
247
- * of your main reseller account ID.
248
- *
249
- * You may also pass a Wix site ID for each product in the body of the call.
250
- * If you omit the site ID, a floating product instance is created.
251
- *
252
- * When Wix customers purchase a specific paid service or product, Wix may offer
253
- * them time-limited free access to a different product. For example, customers
254
- * get a voucher for a free 1-year domain registration when purchasing any Wix
255
- * Premium plan. If you want to offer your customers the same benefit, create a
256
- * package containing the original product first. Then, create a second package
257
- * with the additional product. In the second Create Package call, pass the
258
- * instance ID of the original product as `referenceProductInstanceId`. This way,
259
- * Wix doesn't charge you for the additional product. Make sure that the status
260
- * of the referenced product is either `"PENDING"` or `"ACTIVE"`. Note that you
261
- * can use each product instance only a single time as reference instance.
262
- *
263
- * You need to pass a `countryCode` to specify where customers can claim
264
- * vouchers that may come with a product. Contact the
265
- * [Wix B2B sales team](mailto:bizdev@wix.com) to get information about
266
- * vouchers and supported locations.
267
- *
268
- * > **Important**: This call requires an account level API key and cannot be
269
- * > authenticated with the standard authorization header.
270
- * @public
271
- * @documentationMaturity preview
272
- * @requiredField options.products
273
- * @requiredField options.products.countryCode
274
- * @permissionId premium.reseller-package.manage
275
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.CreatePackageV2
276
- */
277
- async function createPackageV2(options) {
278
- // @ts-ignore
279
- const { httpClient, sideEffects } = arguments[1];
280
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
281
- idempotencyKey: options?.idempotencyKey,
282
- externalId: options?.externalId,
283
- products: options?.products,
284
- });
285
- const reqOpts = ambassadorWixPremiumResellerV1Packages.createPackageV2(payload);
286
- sideEffects?.onSiteCall?.();
287
- try {
288
- const result = await httpClient.request(reqOpts);
289
- sideEffects?.onSuccess?.(result);
290
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
291
- }
292
- catch (err) {
293
- const transformedError = (0, transform_error_1.transformError)(err, {
294
- spreadPathsToArguments: {},
295
- explicitPathsToArguments: {
296
- idempotencyKey: '$[0].idempotencyKey',
297
- externalId: '$[0].externalId',
298
- products: '$[0].products',
299
- },
300
- singleArgumentUnchanged: false,
301
- }, ['options']);
302
- sideEffects?.onError?.(err);
303
- throw transformedError;
304
- }
305
- }
306
- exports.createPackageV2 = createPackageV2;
307
- /**
308
- * Cancels all product instances included in the package and the customer
309
- * immediately loses access to the canceled functionality.
310
- *
311
- *
312
- * You must pass the ID of the Wix account that the package belongs to in the
313
- * header of the call. The call fails, if the package and Wix account don't
314
- * match.
315
- *
316
- * If a canceled product instance is a requirement for another Wix service, that
317
- * functionality is also no longer available to the customer. For example, if
318
- * you cancel a Premium plan, a previously connected domain is automatically
319
- * disconnected from the site.
320
- *
321
- * > **Important**: This call requires an account level API key and cannot be
322
- * > authenticated with the standard authorization header.
323
- * @param _id - ID of the package to cancel.
324
- * @public
325
- * @documentationMaturity preview
326
- * @requiredField _id
327
- * @permissionId premium.reseller-package.manage
328
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.CancelPackage
329
- */
330
- async function cancelPackage(_id, options) {
331
- // @ts-ignore
332
- const { httpClient, sideEffects } = arguments[2];
333
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
334
- id: _id,
335
- idempotencyKey: options?.idempotencyKey,
336
- });
337
- const reqOpts = ambassadorWixPremiumResellerV1Packages.cancelPackage(payload);
338
- sideEffects?.onSiteCall?.();
339
- try {
340
- const result = await httpClient.request(reqOpts);
341
- sideEffects?.onSuccess?.(result);
342
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
343
- }
344
- catch (err) {
345
- const transformedError = (0, transform_error_1.transformError)(err, {
346
- spreadPathsToArguments: {},
347
- explicitPathsToArguments: {
348
- id: '$[0]',
349
- idempotencyKey: '$[1].idempotencyKey',
350
- },
351
- singleArgumentUnchanged: false,
352
- }, ['_id', 'options']);
353
- sideEffects?.onError?.(err);
354
- throw transformedError;
355
- }
356
- }
357
- exports.cancelPackage = cancelPackage;
358
- /**
359
- * Retrieves a package.
360
- *
361
- *
362
- * You must pass the ID of the Wix account that the package belongs to in the
363
- * header of the call. The call fails, if the package and Wix account don't
364
- * match.
365
- *
366
- * > **Important**: This call requires an account level API key and cannot be
367
- * > authenticated with the standard authorization header.
368
- * @param _id - Package ID.
369
- * @public
370
- * @documentationMaturity preview
371
- * @requiredField _id
372
- * @permissionId premium.reseller-package.read
373
- * @returns Retrieved package.
374
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.GetPackage
375
- */
376
- async function getPackage(_id) {
377
- // @ts-ignore
378
- const { httpClient, sideEffects } = arguments[1];
379
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
380
- const reqOpts = ambassadorWixPremiumResellerV1Packages.getPackage(payload);
381
- sideEffects?.onSiteCall?.();
382
- try {
383
- const result = await httpClient.request(reqOpts);
384
- sideEffects?.onSuccess?.(result);
385
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.package;
386
- }
387
- catch (err) {
388
- const transformedError = (0, transform_error_1.transformError)(err, {
389
- spreadPathsToArguments: {},
390
- explicitPathsToArguments: { id: '$[0]' },
391
- singleArgumentUnchanged: false,
392
- }, ['_id']);
393
- sideEffects?.onError?.(err);
394
- throw transformedError;
395
- }
396
- }
397
- exports.getPackage = getPackage;
398
- /**
399
- * Retrieves a list of packages, given the provided paging, filtering, and sorting.
400
- *
401
- *
402
- * You must pass the ID of the Wix account that the packages belong to in the
403
- * header of the call. The call returns packages that belong to the parent
404
- * account, regardless if you pass the ID of a parent or sub-account. In case
405
- * you want to retrieve only packages that belong to a sub-account, you must
406
- * pass the sub-account ID as `filter` in the `query` object like this:
407
- *
408
- * ```json
409
- * {
410
- * "query": {
411
- * "filter": {
412
- * "accountId": {
413
- * "$eq": "<SUB_ACCOUNT_ID>"
414
- * }
415
- * }
416
- * }
417
- * }
418
- * ```
419
- *
420
- * Query Packages runs with these defaults, which you can override:
421
- *
422
- * - `createdDate` is sorted in `DESC` order
423
- * - `cursorPaging.limit` is `100`
424
- *
425
- * By default `pagingMetadata.cursors` are returned, unless you specifically pass
426
- * `query.paging`.
427
- *
428
- * The maximum for `cursorPaging.limit` is `100`.
429
- *
430
- * If you pass a cursor token that you have received in a previous Query Package response,
431
- * passing additional sort or filter information results in an invalid cursor
432
- * error. Since the received cursor token already holds all the needed information
433
- * for sort and filter. Changing the sort and filter properties during the span of
434
- * a cursor query isn't supported. But you can provide a different limit.
435
- *
436
- * For field support for filters and sorting,
437
- * see [Query Packages: Supported Filters and Sorting](https://dev.wix.com/api/rest/account-level-apis/resellers/supported-filters).
438
- *
439
- * To learn about working with _Query_ endpoints, see
440
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
441
- * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
442
- * and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
443
- *
444
- * > **Important**: This call requires an account level API key and cannot be
445
- * > authenticated with the standard authorization header.
446
- * @public
447
- * @documentationMaturity preview
448
- * @permissionId premium.reseller-package.read
449
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.QueryPackages
450
- */
451
- function queryPackages() {
452
- // @ts-ignore
453
- const { httpClient, sideEffects } = arguments[0];
454
- return (0, query_builder_1.queryBuilder)({
455
- func: async (payload) => {
456
- const reqOpts = ambassadorWixPremiumResellerV1Packages.queryPackages(payload);
457
- sideEffects?.onSiteCall?.();
458
- try {
459
- const result = await httpClient.request(reqOpts);
460
- sideEffects?.onSuccess?.(result);
461
- return result;
462
- }
463
- catch (err) {
464
- sideEffects?.onError?.(err);
465
- throw err;
466
- }
467
- },
468
- requestTransformer: (query) => {
469
- const args = [query, {}];
470
- return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
471
- ...args?.[1],
472
- query: args?.[0],
473
- });
474
- },
475
- responseTransformer: ({ data }) => {
476
- const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(data);
477
- return {
478
- items: transformedData?.packages,
479
- pagingMetadata: transformedData?.metadata,
480
- };
481
- },
482
- errorTransformer: (err) => {
483
- const transformedError = (0, transform_error_1.transformError)(err, {
484
- spreadPathsToArguments: {},
485
- explicitPathsToArguments: { query: '$[0]' },
486
- singleArgumentUnchanged: false,
487
- });
488
- throw transformedError;
489
- },
490
- pagingMethod: 'CURSOR',
491
- transformationPaths: {},
492
- });
493
- }
494
- exports.queryPackages = queryPackages;
495
- /**
496
- * Assigns a product instance to a site.
497
- *
498
- * You must pass the ID of the Wix account that the product instance belongs to in the header of the call.
499
- *
500
- * The customer immediately gains access to features included in the assigned service. It's up to the reseller to decide whether assigning a product instance affects the customer’s payment.
501
- *
502
- * It's possible to assign a product instance that's already assigned to a site, to a different site without [unassigning](/packages/unassign-product-instance-from-site) it first. But if the call fails in such a situation, the product instance may either remain assigned to the original site or become unassigned. You can confirm the instance's status by [retrieving the relevant package](/packages/get-package).
503
- *
504
- * > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.
505
- * @public
506
- * @documentationMaturity preview
507
- * @requiredField identifiers
508
- * @requiredField identifiers.instanceId
509
- * @requiredField identifiers.siteId
510
- * @permissionId premium.reseller-package.manage
511
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.AssignProductInstanceToSite
512
- */
513
- async function assignProductInstanceToSite(identifiers, options) {
514
- // @ts-ignore
515
- const { httpClient, sideEffects } = arguments[2];
516
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
517
- instanceId: identifiers?.instanceId,
518
- siteId: identifiers?.siteId,
519
- idempotencyKey: options?.idempotencyKey,
520
- });
521
- const reqOpts = ambassadorWixPremiumResellerV1Packages.assignProductInstanceToSite(payload);
522
- sideEffects?.onSiteCall?.();
523
- try {
524
- const result = await httpClient.request(reqOpts);
525
- sideEffects?.onSuccess?.(result);
526
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
527
- }
528
- catch (err) {
529
- const transformedError = (0, transform_error_1.transformError)(err, {
530
- spreadPathsToArguments: {},
531
- explicitPathsToArguments: {
532
- instanceId: '$[0].instanceId',
533
- siteId: '$[0].siteId',
534
- idempotencyKey: '$[1].idempotencyKey',
535
- },
536
- singleArgumentUnchanged: false,
537
- }, ['identifiers', 'options']);
538
- sideEffects?.onError?.(err);
539
- throw transformedError;
540
- }
541
- }
542
- exports.assignProductInstanceToSite = assignProductInstanceToSite;
543
- /**
544
- * Unassigns a product instance from a site.
545
- *
546
- * You must pass the ID of the Wix account that the product instance belongs to in the header of the call.
547
- *
548
- * The product instance becomes floating and the customer immediately looses access to features included in the unassigned service. It's up to the reseller to decide whether unassigning a product instance affects the customer’s payment.
549
- *
550
- * If an unassigned product instance is a requirement for another service, that service may not be available to the customer any longer. For example, if you unassign a `Combo Plan` plan from a site, a previously connected domain is disconnected.
551
- *
552
- * You can assign floating product instances to sites using the [Assign Product Instance to Site](/packages/assign-product-instance-to-site) method.
553
- *
554
- * > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.
555
- * @param instanceId - ID of the product instance to unassign from a site.
556
- * @public
557
- * @documentationMaturity preview
558
- * @requiredField instanceId
559
- * @permissionId premium.reseller-package.manage
560
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.UnassignProductInstanceFromSite
561
- */
562
- async function unassignProductInstanceFromSite(instanceId, options) {
563
- // @ts-ignore
564
- const { httpClient, sideEffects } = arguments[2];
565
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
566
- instanceId: instanceId,
567
- idempotencyKey: options?.idempotencyKey,
568
- });
569
- const reqOpts = ambassadorWixPremiumResellerV1Packages.unassignProductInstanceFromSite(payload);
570
- sideEffects?.onSiteCall?.();
571
- try {
572
- const result = await httpClient.request(reqOpts);
573
- sideEffects?.onSuccess?.(result);
574
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
575
- }
576
- catch (err) {
577
- const transformedError = (0, transform_error_1.transformError)(err, {
578
- spreadPathsToArguments: {},
579
- explicitPathsToArguments: {
580
- instanceId: '$[0]',
581
- idempotencyKey: '$[1].idempotencyKey',
582
- },
583
- singleArgumentUnchanged: false,
584
- }, ['instanceId', 'options']);
585
- sideEffects?.onError?.(err);
586
- throw transformedError;
587
- }
588
- }
589
- exports.unassignProductInstanceFromSite = unassignProductInstanceFromSite;
590
- /**
591
- * Cancels a product instance.
592
- *
593
- *
594
- * You must pass the ID of the Wix account that the product instance belongs
595
- * to in the header of the call. The call fails, if the product instance and
596
- * Wix account don't match.
597
- *
598
- * The customer immediately loses access to features included in the
599
- * canceled service. It's up to the reseller to decide whether the adjustment
600
- * affects the customer’s payment.
601
- *
602
- * If a canceled service is a requirement for another service, that service
603
- * may not be available to the customer any longer. For example, if you cancel
604
- * a `Combo Plan` plan, a previously connected domain is disconnected
605
- * from the site.
606
- *
607
- *
608
- * > **Important**: This call requires an account level API key and cannot be
609
- * > authenticated with the standard authorization header.
610
- * @param instanceId - ID of the product instance to cancel.
611
- * @public
612
- * @documentationMaturity preview
613
- * @requiredField instanceId
614
- * @permissionId premium.reseller-package.manage
615
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.CancelProductInstance
616
- */
617
- async function cancelProductInstance(instanceId, options) {
618
- // @ts-ignore
619
- const { httpClient, sideEffects } = arguments[2];
620
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
621
- instanceId: instanceId,
622
- idempotencyKey: options?.idempotencyKey,
623
- });
624
- const reqOpts = ambassadorWixPremiumResellerV1Packages.cancelProductInstance(payload);
625
- sideEffects?.onSiteCall?.();
626
- try {
627
- const result = await httpClient.request(reqOpts);
628
- sideEffects?.onSuccess?.(result);
629
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
630
- }
631
- catch (err) {
632
- const transformedError = (0, transform_error_1.transformError)(err, {
633
- spreadPathsToArguments: {},
634
- explicitPathsToArguments: {
635
- instanceId: '$[0]',
636
- idempotencyKey: '$[1].idempotencyKey',
637
- },
638
- singleArgumentUnchanged: false,
639
- }, ['instanceId', 'options']);
640
- sideEffects?.onError?.(err);
641
- throw transformedError;
642
- }
643
- }
644
- exports.cancelProductInstance = cancelProductInstance;
645
- /**
646
- * Upgrades or downgrades a product instance. For example, you can upgrade a
647
- * customer's `Business Unlimited Premium` plan to `Business VIP` using this
648
- * endpoint.
649
- *
650
- *
651
- * You must pass the ID of the Wix account that the product instance belongs
652
- * to in the header of the call. The call fails, if the product instance and
653
- * Wix account don't match.
654
- *
655
- * The customer has immediate access to new features, while losing access to
656
- * features not included in the new service. It's up to the reseller to
657
- * decide whether the adjustment affects the customer’s payment.
658
- *
659
- * You can only exchange a product instance with a service of the same type.
660
- * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for details about
661
- * which services belong to the same type.
662
- *
663
- * You must provide either a new `catalogProductId` or a new `billingInfo`
664
- * object. The new billing cycle must be supported for the product. Contact the
665
- * [Wix B2B sales team](mailto:bizdev@wix.com) for information
666
- * about which billing cycles are supported for each product. If you adjust the
667
- * billing cycle for a product instance with `RECURRING` payments, you must
668
- * also provide `billingInfo.cycleDuration.unit`.
669
- *
670
- * If a removed feature is a requirement for another service, that service
671
- * may not be available to the customer any longer. For example, if you downgrade a
672
- * `Business Unlimited` plan to `Business Basic`, the site owners won’t be
673
- * able to use `Pro eCommerce Features` any longer.
674
- *
675
- * > **Important**: This call requires an account level API key and cannot be
676
- * > authenticated with the standard authorization header.
677
- * @param instanceId - ID of the product instance to adjust.
678
- * @public
679
- * @documentationMaturity preview
680
- * @requiredField instanceId
681
- * @permissionId premium.reseller-package.manage
682
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.AdjustProductInstanceSpecifications
683
- */
684
- async function adjustProductInstanceSpecifications(instanceId, options) {
685
- // @ts-ignore
686
- const { httpClient, sideEffects } = arguments[2];
687
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
688
- instanceId: instanceId,
689
- idempotencyKey: options?.idempotencyKey,
690
- catalogProductId: options?.catalogProductId,
691
- billingInfo: options?.billingInfo,
692
- discountCode: options?.discountCode,
693
- });
694
- const reqOpts = ambassadorWixPremiumResellerV1Packages.adjustProductInstanceSpecifications(payload);
695
- sideEffects?.onSiteCall?.();
696
- try {
697
- const result = await httpClient.request(reqOpts);
698
- sideEffects?.onSuccess?.(result);
699
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
700
- }
701
- catch (err) {
702
- const transformedError = (0, transform_error_1.transformError)(err, {
703
- spreadPathsToArguments: {},
704
- explicitPathsToArguments: {
705
- instanceId: '$[0]',
706
- idempotencyKey: '$[1].idempotencyKey',
707
- catalogProductId: '$[1].catalogProductId',
708
- billingInfo: '$[1].billingInfo',
709
- discountCode: '$[1].discountCode',
710
- },
711
- singleArgumentUnchanged: false,
712
- }, ['instanceId', 'options']);
713
- sideEffects?.onError?.(err);
714
- throw transformedError;
715
- }
716
- }
717
- exports.adjustProductInstanceSpecifications = adjustProductInstanceSpecifications;
718
- /**
719
- * Updates a package's external ID field.
720
- * @public
721
- * @documentationMaturity preview
722
- * @requiredField identifiers
723
- * @requiredField identifiers.externalId
724
- * @requiredField identifiers.packageId
725
- * @permissionId PREMIUM.PACKAGE_UPDATE_EXTERNAL_ID
726
- * @fqn com.wixpress.premium.reseller.packages.v1.Packages.UpdatePackageExternalId
727
- */
728
- async function updatePackageExternalId(identifiers) {
729
- // @ts-ignore
730
- const { httpClient, sideEffects } = arguments[1];
731
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
732
- packageId: identifiers?.packageId,
733
- externalId: identifiers?.externalId,
734
- });
735
- const reqOpts = ambassadorWixPremiumResellerV1Packages.updatePackageExternalId(payload);
736
- sideEffects?.onSiteCall?.();
737
- try {
738
- const result = await httpClient.request(reqOpts);
739
- sideEffects?.onSuccess?.(result);
740
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
741
- }
742
- catch (err) {
743
- const transformedError = (0, transform_error_1.transformError)(err, {
744
- spreadPathsToArguments: {},
745
- explicitPathsToArguments: {
746
- packageId: '$[0].packageId',
747
- externalId: '$[0].externalId',
748
- },
749
- singleArgumentUnchanged: false,
750
- }, ['identifiers']);
751
- sideEffects?.onError?.(err);
752
- throw transformedError;
753
- }
754
- }
755
- exports.updatePackageExternalId = updatePackageExternalId;
756
- //# sourceMappingURL=premium-reseller-v1-packages-packages.universal.js.map