@wix/auto_sdk_app-management_billing 1.0.5 → 1.0.6

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 (134) hide show
  1. package/build/{es/src/devcenter-checkout-v1-purchased-item-billing.universal.d.ts → devcenter-checkout-v1-purchased-item-billing.universal-BvkvBr8A.d.mts} +24 -84
  2. package/build/{cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.d.ts → devcenter-checkout-v1-purchased-item-billing.universal-BvkvBr8A.d.ts} +24 -84
  3. package/build/index.d.mts +47 -0
  4. package/build/index.d.ts +47 -0
  5. package/build/index.js +359 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +329 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/{cjs/src/devcenter-checkout-v1-purchased-item-billing.types.d.ts → internal/devcenter-checkout-v1-purchased-item-billing.universal-Bv6aTKH_.d.mts} +90 -19
  10. package/build/{es/src/devcenter-checkout-v1-purchased-item-billing.types.d.ts → internal/devcenter-checkout-v1-purchased-item-billing.universal-Bv6aTKH_.d.ts} +90 -19
  11. package/build/internal/index.d.mts +64 -0
  12. package/build/internal/index.d.ts +64 -0
  13. package/build/internal/index.js +359 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +329 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +139 -0
  18. package/build/internal/meta.d.ts +139 -0
  19. package/build/internal/meta.js +240 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +211 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +139 -0
  24. package/build/meta.d.ts +139 -0
  25. package/build/meta.js +240 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +211 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.d.ts +0 -14
  40. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.js +0 -22
  41. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.js.map +0 -1
  42. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.d.ts +0 -35
  43. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.js +0 -184
  44. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.js.map +0 -1
  45. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.d.ts +0 -15
  46. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.js +0 -85
  47. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.js.map +0 -1
  48. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.d.ts +0 -38
  49. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.js +0 -32
  50. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.js.map +0 -1
  51. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.js +0 -32
  52. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.js.map +0 -1
  53. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.js +0 -207
  54. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/package.json +0 -3
  65. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.context.d.ts +0 -14
  66. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.context.js +0 -16
  67. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.context.js.map +0 -1
  68. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.http.d.ts +0 -35
  69. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.http.js +0 -178
  70. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.http.js.map +0 -1
  71. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.meta.d.ts +0 -15
  72. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.meta.js +0 -56
  73. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.meta.js.map +0 -1
  74. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.public.d.ts +0 -38
  75. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.public.js +0 -23
  76. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.public.js.map +0 -1
  77. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.types.js +0 -29
  78. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.types.js.map +0 -1
  79. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.universal.js +0 -178
  80. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.universal.js.map +0 -1
  81. package/build/internal/cjs/index.d.ts +0 -1
  82. package/build/internal/cjs/index.js +0 -18
  83. package/build/internal/cjs/index.js.map +0 -1
  84. package/build/internal/cjs/index.typings.d.ts +0 -1
  85. package/build/internal/cjs/index.typings.js +0 -18
  86. package/build/internal/cjs/index.typings.js.map +0 -1
  87. package/build/internal/cjs/meta.d.ts +0 -1
  88. package/build/internal/cjs/meta.js +0 -18
  89. package/build/internal/cjs/meta.js.map +0 -1
  90. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.d.ts +0 -16
  91. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.js +0 -22
  92. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.js.map +0 -1
  93. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.d.ts +0 -35
  94. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.js +0 -184
  95. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.js.map +0 -1
  96. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.d.ts +0 -15
  97. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.js +0 -85
  98. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.js.map +0 -1
  99. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.d.ts +0 -53
  100. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.js +0 -32
  101. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.js.map +0 -1
  102. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.d.ts +0 -250
  103. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.js +0 -32
  104. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.js.map +0 -1
  105. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.d.ts +0 -401
  106. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.js +0 -207
  107. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.js.map +0 -1
  108. package/build/internal/es/index.d.ts +0 -1
  109. package/build/internal/es/index.js +0 -2
  110. package/build/internal/es/index.js.map +0 -1
  111. package/build/internal/es/index.typings.d.ts +0 -1
  112. package/build/internal/es/index.typings.js +0 -2
  113. package/build/internal/es/index.typings.js.map +0 -1
  114. package/build/internal/es/meta.d.ts +0 -1
  115. package/build/internal/es/meta.js +0 -2
  116. package/build/internal/es/meta.js.map +0 -1
  117. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.context.d.ts +0 -16
  118. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.context.js +0 -16
  119. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.context.js.map +0 -1
  120. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.http.d.ts +0 -35
  121. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.http.js +0 -178
  122. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.http.js.map +0 -1
  123. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.meta.d.ts +0 -15
  124. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.meta.js +0 -56
  125. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.meta.js.map +0 -1
  126. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.public.d.ts +0 -53
  127. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.public.js +0 -23
  128. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.public.js.map +0 -1
  129. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.types.d.ts +0 -250
  130. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.types.js +0 -29
  131. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.types.js.map +0 -1
  132. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.universal.d.ts +0 -401
  133. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.universal.js +0 -178
  134. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.universal.js.map +0 -1
@@ -0,0 +1,329 @@
1
+ // src/devcenter-checkout-v1-purchased-item-billing.public.ts
2
+ import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
3
+ import { EventDefinition } from "@wix/sdk-types";
4
+
5
+ // src/devcenter-checkout-v1-purchased-item-billing.universal.ts
6
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
7
+ import {
8
+ renameKeysFromSDKRequestToRESTRequest,
9
+ renameKeysFromRESTResponseToSDKResponse
10
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
11
+
12
+ // src/devcenter-checkout-v1-purchased-item-billing.http.ts
13
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
14
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
15
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
16
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
17
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
18
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
19
+ function resolveComWixpressMarketAimApiCheckoutUrl(opts) {
20
+ const domainToMappings = {
21
+ "api._api_base_domain_": [
22
+ {
23
+ srcPath: "/app-instance-manager-webapp",
24
+ destPath: ""
25
+ }
26
+ ],
27
+ "www.wixapis.com": [
28
+ {
29
+ srcPath: "/apps",
30
+ destPath: ""
31
+ }
32
+ ],
33
+ "wixapis.com": [
34
+ {
35
+ srcPath: "/apps",
36
+ destPath: ""
37
+ }
38
+ ],
39
+ "dev._base_domain_": [
40
+ {
41
+ srcPath: "/_api/app-instance-manager",
42
+ destPath: ""
43
+ },
44
+ {
45
+ srcPath: "/api/v1/instance",
46
+ destPath: "/v1/instance"
47
+ },
48
+ {
49
+ srcPath: "/api/v1/scripts",
50
+ destPath: "/v1/scripts"
51
+ }
52
+ ],
53
+ "manage._base_domain_": [
54
+ {
55
+ srcPath: "/_api/app-instance-manager",
56
+ destPath: ""
57
+ }
58
+ ],
59
+ "www._base_domain_": [
60
+ {
61
+ srcPath: "/_api/app-instance-manager",
62
+ destPath: ""
63
+ }
64
+ ],
65
+ "editor._base_domain_": [
66
+ {
67
+ srcPath: "/_api/app-instance-manager",
68
+ destPath: ""
69
+ }
70
+ ],
71
+ "blocks._base_domain_": [
72
+ {
73
+ srcPath: "/_api/app-instance-manager",
74
+ destPath: ""
75
+ }
76
+ ],
77
+ "create.editorx": [
78
+ {
79
+ srcPath: "/_api/app-instance-manager",
80
+ destPath: ""
81
+ }
82
+ ]
83
+ };
84
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
85
+ }
86
+ var PACKAGE_NAME = "@wix/auto_sdk_app-management_billing";
87
+ function getUrl(payload) {
88
+ function __getUrl({ host }) {
89
+ const serializedData = transformPaths(payload, [
90
+ {
91
+ transformFn: transformSDKFloatToRESTFloat,
92
+ paths: [{ path: "chargeOverride.price" }]
93
+ }
94
+ ]);
95
+ const metadata = {
96
+ entityFqdn: "wix.devcenter.checkout.v1.purchased_item",
97
+ method: "POST",
98
+ methodFqn: "com.wixpress.market.aim.api.Checkout.GetUrl",
99
+ packageName: PACKAGE_NAME,
100
+ url: resolveComWixpressMarketAimApiCheckoutUrl({
101
+ protoPath: "/v1/checkout",
102
+ data: serializedData,
103
+ host
104
+ }),
105
+ data: serializedData
106
+ };
107
+ return metadata;
108
+ }
109
+ return __getUrl;
110
+ }
111
+ function getPurchaseHistory(payload) {
112
+ function __getPurchaseHistory({ host }) {
113
+ const metadata = {
114
+ entityFqdn: "wix.devcenter.checkout.v1.purchased_item",
115
+ method: "GET",
116
+ methodFqn: "com.wixpress.market.aim.api.Checkout.GetPurchaseHistory",
117
+ packageName: PACKAGE_NAME,
118
+ url: resolveComWixpressMarketAimApiCheckoutUrl({
119
+ protoPath: "/v1/checkout/history",
120
+ data: payload,
121
+ host
122
+ }),
123
+ params: toURLSearchParams(payload),
124
+ transformResponse: (payload2) => transformPaths(payload2, [
125
+ {
126
+ transformFn: transformRESTTimestampToSDKTimestamp,
127
+ paths: [{ path: "purchases.dateCreated" }]
128
+ }
129
+ ])
130
+ };
131
+ return metadata;
132
+ }
133
+ return __getPurchaseHistory;
134
+ }
135
+ function getMeteredBillingCharges(payload) {
136
+ function __getMeteredBillingCharges({ host }) {
137
+ const serializedData = transformPaths(payload, [
138
+ {
139
+ transformFn: transformSDKTimestampToRESTTimestamp,
140
+ paths: [{ path: "startDate" }, { path: "endDate" }]
141
+ }
142
+ ]);
143
+ const metadata = {
144
+ entityFqdn: "wix.devcenter.checkout.v1.purchased_item",
145
+ method: "GET",
146
+ methodFqn: "com.wixpress.market.aim.api.Checkout.GetMeteredBillingCharges",
147
+ packageName: PACKAGE_NAME,
148
+ url: resolveComWixpressMarketAimApiCheckoutUrl({
149
+ protoPath: "/v1/metered-billing-charges",
150
+ data: serializedData,
151
+ host
152
+ }),
153
+ params: toURLSearchParams(serializedData)
154
+ };
155
+ return metadata;
156
+ }
157
+ return __getMeteredBillingCharges;
158
+ }
159
+
160
+ // src/devcenter-checkout-v1-purchased-item-billing.universal.ts
161
+ var PaymentCycle = /* @__PURE__ */ ((PaymentCycle2) => {
162
+ PaymentCycle2["NO_CYCLE"] = "NO_CYCLE";
163
+ PaymentCycle2["MONTHLY"] = "MONTHLY";
164
+ PaymentCycle2["YEARLY"] = "YEARLY";
165
+ PaymentCycle2["ONE_TIME"] = "ONE_TIME";
166
+ PaymentCycle2["TWO_YEARS"] = "TWO_YEARS";
167
+ PaymentCycle2["THREE_YEARS"] = "THREE_YEARS";
168
+ PaymentCycle2["FOUR_YEARS"] = "FOUR_YEARS";
169
+ PaymentCycle2["FIVE_YEARS"] = "FIVE_YEARS";
170
+ return PaymentCycle2;
171
+ })(PaymentCycle || {});
172
+ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
173
+ InvoiceStatus2["UNKNOWN_INVOICE_STATUS"] = "UNKNOWN_INVOICE_STATUS";
174
+ InvoiceStatus2["PAYMENT_FAILED"] = "PAYMENT_FAILED";
175
+ InvoiceStatus2["PAID"] = "PAID";
176
+ InvoiceStatus2["REFUNDED"] = "REFUNDED";
177
+ InvoiceStatus2["VOIDED"] = "VOIDED";
178
+ InvoiceStatus2["CHARGEDBACK"] = "CHARGEDBACK";
179
+ return InvoiceStatus2;
180
+ })(InvoiceStatus || {});
181
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
182
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
183
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
184
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
185
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
186
+ WebhookIdentityType2["APP"] = "APP";
187
+ return WebhookIdentityType2;
188
+ })(WebhookIdentityType || {});
189
+ async function getUrl2(productId, options) {
190
+ const { httpClient, sideEffects } = arguments[2];
191
+ const payload = renameKeysFromSDKRequestToRESTRequest({
192
+ productId,
193
+ successUrl: options?.successUrl,
194
+ testCheckout: options?.testCheckout,
195
+ billingCycle: options?.billingCycle,
196
+ countryCode: options?.countryCode,
197
+ languageCode: options?.languageCode,
198
+ couponCode: options?.couponCode
199
+ });
200
+ const reqOpts = getUrl(payload);
201
+ sideEffects?.onSiteCall?.();
202
+ try {
203
+ const result = await httpClient.request(reqOpts);
204
+ sideEffects?.onSuccess?.(result);
205
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
206
+ } catch (err) {
207
+ const transformedError = sdkTransformError(
208
+ err,
209
+ {
210
+ spreadPathsToArguments: {},
211
+ explicitPathsToArguments: {
212
+ productId: "$[0]",
213
+ successUrl: "$[1].successUrl",
214
+ testCheckout: "$[1].testCheckout",
215
+ billingCycle: "$[1].billingCycle",
216
+ countryCode: "$[1].countryCode",
217
+ languageCode: "$[1].languageCode",
218
+ couponCode: "$[1].couponCode"
219
+ },
220
+ singleArgumentUnchanged: false
221
+ },
222
+ ["productId", "options"]
223
+ );
224
+ sideEffects?.onError?.(err);
225
+ throw transformedError;
226
+ }
227
+ }
228
+ async function getPurchaseHistory2() {
229
+ const { httpClient, sideEffects } = arguments[0];
230
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
231
+ const reqOpts = getPurchaseHistory(payload);
232
+ sideEffects?.onSiteCall?.();
233
+ try {
234
+ const result = await httpClient.request(reqOpts);
235
+ sideEffects?.onSuccess?.(result);
236
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
237
+ } catch (err) {
238
+ const transformedError = sdkTransformError(
239
+ err,
240
+ {
241
+ spreadPathsToArguments: {},
242
+ explicitPathsToArguments: {},
243
+ singleArgumentUnchanged: false
244
+ },
245
+ []
246
+ );
247
+ sideEffects?.onError?.(err);
248
+ throw transformedError;
249
+ }
250
+ }
251
+ async function getMeteredBillingCharges2(options) {
252
+ const { httpClient, sideEffects } = arguments[1];
253
+ const payload = renameKeysFromSDKRequestToRESTRequest({
254
+ currency: options?.currency,
255
+ startDate: options?.startDate,
256
+ endDate: options?.endDate
257
+ });
258
+ const reqOpts = getMeteredBillingCharges(
259
+ payload
260
+ );
261
+ sideEffects?.onSiteCall?.();
262
+ try {
263
+ const result = await httpClient.request(reqOpts);
264
+ sideEffects?.onSuccess?.(result);
265
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
266
+ } catch (err) {
267
+ const transformedError = sdkTransformError(
268
+ err,
269
+ {
270
+ spreadPathsToArguments: {},
271
+ explicitPathsToArguments: {
272
+ currency: "$[0].currency",
273
+ startDate: "$[0].startDate",
274
+ endDate: "$[0].endDate"
275
+ },
276
+ singleArgumentUnchanged: false
277
+ },
278
+ ["options"]
279
+ );
280
+ sideEffects?.onError?.(err);
281
+ throw transformedError;
282
+ }
283
+ }
284
+
285
+ // src/devcenter-checkout-v1-purchased-item-billing.public.ts
286
+ function getUrl3(httpClient) {
287
+ return (productId, options) => getUrl2(
288
+ productId,
289
+ options,
290
+ // @ts-ignore
291
+ { httpClient }
292
+ );
293
+ }
294
+ function getPurchaseHistory3(httpClient) {
295
+ return () => getPurchaseHistory2(
296
+ // @ts-ignore
297
+ { httpClient }
298
+ );
299
+ }
300
+ function getMeteredBillingCharges3(httpClient) {
301
+ return (options) => getMeteredBillingCharges2(
302
+ options,
303
+ // @ts-ignore
304
+ { httpClient }
305
+ );
306
+ }
307
+ var onPurchasedItemInvoiceStatusUpdated = EventDefinition(
308
+ "InvoiceStatusUpdated",
309
+ false,
310
+ (event) => renameKeysFromRESTResponseToSDKResponse2(event)
311
+ )();
312
+
313
+ // src/devcenter-checkout-v1-purchased-item-billing.context.ts
314
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
315
+ import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
316
+ var getUrl4 = /* @__PURE__ */ createRESTModule(getUrl3);
317
+ var getPurchaseHistory4 = /* @__PURE__ */ createRESTModule(getPurchaseHistory3);
318
+ var getMeteredBillingCharges4 = /* @__PURE__ */ createRESTModule(getMeteredBillingCharges3);
319
+ var onPurchasedItemInvoiceStatusUpdated2 = createEventModule(onPurchasedItemInvoiceStatusUpdated);
320
+ export {
321
+ InvoiceStatus,
322
+ PaymentCycle,
323
+ WebhookIdentityType,
324
+ getMeteredBillingCharges4 as getMeteredBillingCharges,
325
+ getPurchaseHistory4 as getPurchaseHistory,
326
+ getUrl4 as getUrl,
327
+ onPurchasedItemInvoiceStatusUpdated2 as onPurchasedItemInvoiceStatusUpdated
328
+ };
329
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/devcenter-checkout-v1-purchased-item-billing.public.ts","../src/devcenter-checkout-v1-purchased-item-billing.universal.ts","../src/devcenter-checkout-v1-purchased-item-billing.http.ts","../src/devcenter-checkout-v1-purchased-item-billing.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { EventDefinition, HttpClient } from '@wix/sdk-types';\nimport {\n GetMeteredBillingChargesOptions,\n GetMeteredBillingChargesResponse,\n GetPurchaseHistoryResponse,\n GetUrlOptions,\n GetUrlResponse,\n PurchasedItemInvoiceStatusUpdatedEnvelope,\n getMeteredBillingCharges as universalGetMeteredBillingCharges,\n getPurchaseHistory as universalGetPurchaseHistory,\n getUrl as universalGetUrl,\n} from './devcenter-checkout-v1-purchased-item-billing.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\nexport function getUrl(httpClient: HttpClient): GetUrlSignature {\n return (productId: string, options?: GetUrlOptions) =>\n universalGetUrl(\n productId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetUrlSignature {\n /**\n * Retrieves the URL for a Wix checkout page for the specified paid plan of your app.\n *\n *\n * This call succeeds only in case you have previously\n * [set up an external pricing page in your app's dashboard](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/set-up-an-external-pricing-page).\n *\n * The returned checkout URL is valid for 48 hours.\n *\n * This API allows your app to manage your pricing page outside of Wix while\n * still using the standard Wix checkout flow.\n * @param - ID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard\n * for a list of your app's supported product IDs.\n */\n (\n productId: string,\n options?: GetUrlOptions | undefined\n ): Promise<GetUrlResponse>;\n}\n\nexport function getPurchaseHistory(\n httpClient: HttpClient\n): GetPurchaseHistorySignature {\n return () =>\n universalGetPurchaseHistory(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetPurchaseHistorySignature {\n /**\n * Retrieves a list of the site owner's past purchases for your app.\n *\n *\n * You don't have to explicitly pass an identifier for the Wix site as part of\n * the request, since this information is taken automatically from the context.\n *\n * The response doesn't include any details about cancellations.\n */\n (): Promise<GetPurchaseHistoryResponse>;\n}\n\n/** @internal */\nexport function getMeteredBillingCharges(\n httpClient: HttpClient\n): GetMeteredBillingChargesSignature {\n return (options?: GetMeteredBillingChargesOptions) =>\n universalGetMeteredBillingCharges(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetMeteredBillingChargesSignature {\n /**\n * Triggers Wix to call the\n * [List Custom Charges SPI](https://dev.wix.com/docs/rest/internal-only/premium/custom-charges-spi/custom-charges-provider-v1/list-charges).\n *\n *\n * Wix doesn't use the response from _List Charges_ SPI to actually create an\n * invoice that's sent to the customer. Instead, calling _Get Metered Billing Charges_\n * allows you confirm that your integration with the Custom Charges SPI is\n * working as intended.\n */\n (\n options?: GetMeteredBillingChargesOptions | undefined\n ): Promise<GetMeteredBillingChargesResponse>;\n}\n\nexport const onPurchasedItemInvoiceStatusUpdated = EventDefinition(\n 'InvoiceStatusUpdated',\n false,\n (event: PurchasedItemInvoiceStatusUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(event)\n)<PurchasedItemInvoiceStatusUpdatedEnvelope>();\n\nexport {\n BaseEventMetadata,\n Charge,\n ChargeOverride,\n GetMeteredBillingChargesOptions,\n GetMeteredBillingChargesRequest,\n GetMeteredBillingChargesResponse,\n GetPurchaseHistoryRequest,\n GetPurchaseHistoryResponse,\n GetSitePaymentMethodsStatusRequest,\n GetSitePaymentMethodsStatusResponse,\n GetUrlOptions,\n GetUrlRequest,\n GetUrlResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n InvoiceStatus,\n InvoiceStatusUpdated,\n MessageEnvelope,\n PaymentCycle,\n PurchasedItem,\n PurchasedItemInvoiceStatusUpdatedEnvelope,\n WebhookIdentityType,\n} from './devcenter-checkout-v1-purchased-item-billing.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterCheckoutV1PurchasedItem from './devcenter-checkout-v1-purchased-item-billing.http.js';\n\nexport interface PurchasedItem {\n /** ID of your app's paid plan. */\n productId?: string;\n /** Price of your app's paid plan. For example, `9.95`. */\n price?: string;\n /**\n * 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n */\n currency?: string;\n /** Information about the billing cycle for your app's paid plan. */\n billingCycle?: PaymentCycle;\n /**\n * Date and time the site onwers have purchased your app's paid plan in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n dateCreated?: Date | null;\n}\n\nexport enum PaymentCycle {\n NO_CYCLE = 'NO_CYCLE',\n MONTHLY = 'MONTHLY',\n YEARLY = 'YEARLY',\n ONE_TIME = 'ONE_TIME',\n TWO_YEARS = 'TWO_YEARS',\n THREE_YEARS = 'THREE_YEARS',\n FOUR_YEARS = 'FOUR_YEARS',\n FIVE_YEARS = 'FIVE_YEARS',\n}\n\nexport interface InvoiceStatusUpdated {\n /** Invoice payment status. */\n status?: InvoiceStatus;\n /**\n * Wix Premium invoice ID.\n * @maxLength 50\n */\n invoiceId?: string;\n /**\n * App instance ID - a unique ID assigned to each app in each site.\n * @format GUID\n */\n instanceId?: string | null;\n /** Whether the invoice is for a single payment or for multiple, recurring payments. */\n recurring?: boolean;\n}\n\nexport enum InvoiceStatus {\n UNKNOWN_INVOICE_STATUS = 'UNKNOWN_INVOICE_STATUS',\n PAYMENT_FAILED = 'PAYMENT_FAILED',\n PAID = 'PAID',\n REFUNDED = 'REFUNDED',\n VOIDED = 'VOIDED',\n CHARGEDBACK = 'CHARGEDBACK',\n}\n\nexport interface GetUrlRequest {\n /**\n * ID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard\n * for a list of your app's supported product IDs.\n */\n productId: string;\n /**\n * URL for the Wix checkout page. Redirect site owners to this URL after\n * they've successfully purchased a paid plan for your app.\n * @format WEB_URL\n */\n successUrl?: string | null;\n /**\n * Whether the checkout is for testing purposes only. Testing is mainly\n * relevant for in-app purchase flows. When `true`, Wix charges the site\n * owners an amount of `0.00`.\n */\n testCheckout?: boolean;\n /** Information about the paid plan's billing cycle. */\n billingCycle?: PaymentCycle;\n /**\n * 2-letter country code in\n * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format.\n *\n * Default: `\"US\"`\n */\n countryCode?: string | null;\n /**\n * 2-letter language code in\n * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.\n *\n * Default: `\"EN\"`\n */\n languageCode?: string | null;\n /** Coupon code for the paid plan. Available only in case there is a discount. */\n couponCode?: string | null;\n}\n\nexport interface ChargeOverride {\n /**\n * Override price. In case you omit the override price, Wix charges site\n * owners the app's default price that's configured in the Pricing page of your app's dashboard.\n */\n price?: number;\n /**\n * Override 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n */\n currency?: string;\n}\n\nexport interface GetUrlResponse {\n /**\n * URL for the Wix checkout page.\n * @format WEB_URL\n */\n checkoutUrl?: string;\n /**\n * Token for the Wix checkout page. The token holds all data about the order\n * you're creating a checkout for. It is [signed](),\n * so you can verify that it comes from Wix.\n */\n token?: string | null;\n}\n\nexport interface GetPurchaseHistoryRequest {}\n\nexport interface GetPurchaseHistoryResponse {\n /** Retrieved purchases the site owners have completed for you app. */\n purchases?: PurchasedItem[];\n}\n\nexport interface GetSitePaymentMethodsStatusRequest {}\n\nexport interface GetSitePaymentMethodsStatusResponse {\n /**\n * Whether the site owners have enabled at least a single online payment method.\n * Online payment methods include Wix Payments, Stripe, PayPal, and credit\n * cards.\n */\n onlineProviderEnabled?: boolean;\n /** Whether the site owners accept offline payments. */\n offlineProviderEnabled?: boolean;\n /**\n * Whether the site owners have enabled the\n * [Wix Point of Sale](https://www.wix.com/pos).\n * This allows their customers to make electronic payments in person.\n */\n wixPosProviderEnabled?: boolean;\n /**\n * Whether the site owners have enabled at least one 3rd-party point-of-sale\n * provider. This allows their customers to make electronic payments in person.\n */\n thirdPartyPosProviderEnabled?: boolean;\n}\n\nexport interface GetMeteredBillingChargesRequest {\n /**\n * 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n * @format CURRENCY\n */\n currency?: string | null;\n /**\n * Start of the period you want to retrieve the custom charges for in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n startDate?: Date | null;\n /**\n * End of the period you want to retrieve the custom charges for in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n endDate?: Date | null;\n}\n\nexport interface GetMeteredBillingChargesResponse {\n /** List of retrieved custom charges. */\n charges?: Charge[];\n}\n\nexport interface Charge {\n /** ID of the custom charge. The ID consists of 64 characters. */\n _id?: string | null;\n /** Description of the custom charge. */\n description?: string;\n /**\n * Charge amount.\n *\n * Min: `0.50`\n * @format DECIMAL_VALUE\n * @decimalValue options { gt:0.00 }\n */\n amount?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface PurchasedItemInvoiceStatusUpdatedEnvelope {\n data: InvoiceStatusUpdated;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when there is an update to the payment status of an invoice.\n * Charges made using the [Custom Charges SPI](https://dev.wix.com/docs/rest/app-management/app-billing/custom-charges-service-plugin/introduction) may be based on usage.\n * Learn more about [usage-based charges](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/set-up-a-usage-based-business-model).\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType InvoiceStatusUpdated\n * @serviceIdentifier com.wixpress.market.aim.api.Checkout\n * @slug invoice_status_updated\n */\nexport declare function onPurchasedItemInvoiceStatusUpdated(\n handler: (\n event: PurchasedItemInvoiceStatusUpdatedEnvelope\n ) => void | Promise<void>\n): void;\n\ntype PurchasedItemNonNullablePaths =\n | `productId`\n | `price`\n | `currency`\n | `billingCycle`;\n\n/**\n * Retrieves the URL for a Wix checkout page for the specified paid plan of your app.\n *\n *\n * This call succeeds only in case you have previously\n * [set up an external pricing page in your app's dashboard](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/set-up-an-external-pricing-page).\n *\n * The returned checkout URL is valid for 48 hours.\n *\n * This API allows your app to manage your pricing page outside of Wix while\n * still using the standard Wix checkout flow.\n * @param productId - ID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard\n * for a list of your app's supported product IDs.\n * @public\n * @requiredField productId\n * @permissionId WIX_DEVELOPERS.CREATE_CHECKOUT\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.Checkout.GetUrl\n */\nexport async function getUrl(\n productId: string,\n options?: GetUrlOptions\n): Promise<NonNullablePaths<GetUrlResponse, `checkoutUrl`>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n productId: productId,\n successUrl: options?.successUrl,\n testCheckout: options?.testCheckout,\n billingCycle: options?.billingCycle,\n countryCode: options?.countryCode,\n languageCode: options?.languageCode,\n couponCode: options?.couponCode,\n });\n\n const reqOpts = ambassadorWixDevcenterCheckoutV1PurchasedItem.getUrl(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n productId: '$[0]',\n successUrl: '$[1].successUrl',\n testCheckout: '$[1].testCheckout',\n billingCycle: '$[1].billingCycle',\n countryCode: '$[1].countryCode',\n languageCode: '$[1].languageCode',\n couponCode: '$[1].couponCode',\n },\n singleArgumentUnchanged: false,\n },\n ['productId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetUrlOptions {\n /**\n * URL for the Wix checkout page. Redirect site owners to this URL after\n * they've successfully purchased a paid plan for your app.\n * @format WEB_URL\n */\n successUrl?: string | null;\n /**\n * Whether the checkout is for testing purposes only. Testing is mainly\n * relevant for in-app purchase flows. When `true`, Wix charges the site\n * owners an amount of `0.00`.\n */\n testCheckout?: boolean;\n /** Information about the paid plan's billing cycle. */\n billingCycle?: PaymentCycle;\n /**\n * 2-letter country code in\n * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format.\n *\n * Default: `\"US\"`\n */\n countryCode?: string | null;\n /**\n * 2-letter language code in\n * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.\n *\n * Default: `\"EN\"`\n */\n languageCode?: string | null;\n /** Coupon code for the paid plan. Available only in case there is a discount. */\n couponCode?: string | null;\n}\n\n/**\n * Retrieves a list of the site owner's past purchases for your app.\n *\n *\n * You don't have to explicitly pass an identifier for the Wix site as part of\n * the request, since this information is taken automatically from the context.\n *\n * The response doesn't include any details about cancellations.\n * @public\n * @permissionId WIX_DEVELOPERS.APP_PURCHASE_HISTORY\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.Checkout.GetPurchaseHistory\n */\nexport async function getPurchaseHistory(): Promise<\n NonNullablePaths<\n GetPurchaseHistoryResponse,\n {\n [P in PurchasedItemNonNullablePaths]: `purchases.${number}.${P}`;\n }[PurchasedItemNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixDevcenterCheckoutV1PurchasedItem.getPurchaseHistory(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Triggers Wix to call the\n * [List Custom Charges SPI](https://dev.wix.com/docs/rest/internal-only/premium/custom-charges-spi/custom-charges-provider-v1/list-charges).\n *\n *\n * Wix doesn't use the response from _List Charges_ SPI to actually create an\n * invoice that's sent to the customer. Instead, calling _Get Metered Billing Charges_\n * allows you confirm that your integration with the Custom Charges SPI is\n * working as intended.\n * @internal\n * @documentationMaturity preview\n * @permissionId WIX_DEVELOPERS.METERED_BILLING_CHARGES_READ\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.Checkout.GetMeteredBillingCharges\n */\nexport async function getMeteredBillingCharges(\n options?: GetMeteredBillingChargesOptions\n): Promise<\n NonNullablePaths<\n GetMeteredBillingChargesResponse,\n `charges` | `charges.${number}.description` | `charges.${number}.amount`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n currency: options?.currency,\n startDate: options?.startDate,\n endDate: options?.endDate,\n });\n\n const reqOpts =\n ambassadorWixDevcenterCheckoutV1PurchasedItem.getMeteredBillingCharges(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n currency: '$[0].currency',\n startDate: '$[0].startDate',\n endDate: '$[0].endDate',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetMeteredBillingChargesOptions {\n /**\n * 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n * @format CURRENCY\n */\n currency?: string | null;\n /**\n * Start of the period you want to retrieve the custom charges for in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n startDate?: Date | null;\n /**\n * End of the period you want to retrieve the custom charges for in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n endDate?: Date | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressMarketAimApiCheckoutUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/app-instance-manager-webapp',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n {\n srcPath: '/api/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/api/v1/scripts',\n destPath: '/v1/scripts',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_billing';\n\n/**\n * Retrieves the URL for a Wix checkout page for the specified paid plan of your app.\n *\n *\n * This call succeeds only in case you have previously\n * [set up an external pricing page in your app's dashboard](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/set-up-an-external-pricing-page).\n *\n * The returned checkout URL is valid for 48 hours.\n *\n * This API allows your app to manage your pricing page outside of Wix while\n * still using the standard Wix checkout flow.\n */\nexport function getUrl(payload: object): RequestOptionsFactory<any> {\n function __getUrl({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [{ path: 'chargeOverride.price' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.checkout.v1.purchased_item',\n method: 'POST' as any,\n methodFqn: 'com.wixpress.market.aim.api.Checkout.GetUrl',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressMarketAimApiCheckoutUrl({\n protoPath: '/v1/checkout',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __getUrl;\n}\n\n/**\n * Retrieves a list of the site owner's past purchases for your app.\n *\n *\n * You don't have to explicitly pass an identifier for the Wix site as part of\n * the request, since this information is taken automatically from the context.\n *\n * The response doesn't include any details about cancellations.\n */\nexport function getPurchaseHistory(\n payload: object\n): RequestOptionsFactory<any> {\n function __getPurchaseHistory({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.checkout.v1.purchased_item',\n method: 'GET' as any,\n methodFqn: 'com.wixpress.market.aim.api.Checkout.GetPurchaseHistory',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressMarketAimApiCheckoutUrl({\n protoPath: '/v1/checkout/history',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'purchases.dateCreated' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getPurchaseHistory;\n}\n\n/**\n * Triggers Wix to call the\n * [List Custom Charges SPI](https://dev.wix.com/docs/rest/internal-only/premium/custom-charges-spi/custom-charges-provider-v1/list-charges).\n *\n *\n * Wix doesn't use the response from _List Charges_ SPI to actually create an\n * invoice that's sent to the customer. Instead, calling _Get Metered Billing Charges_\n * allows you confirm that your integration with the Custom Charges SPI is\n * working as intended.\n */\nexport function getMeteredBillingCharges(\n payload: object\n): RequestOptionsFactory<any> {\n function __getMeteredBillingCharges({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'startDate' }, { path: 'endDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.checkout.v1.purchased_item',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.market.aim.api.Checkout.GetMeteredBillingCharges',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressMarketAimApiCheckoutUrl({\n protoPath: '/v1/metered-billing-charges',\n data: serializedData,\n host,\n }),\n params: toURLSearchParams(serializedData),\n };\n\n return metadata;\n }\n\n return __getMeteredBillingCharges;\n}\n","import {\n getUrl as publicGetUrl,\n getPurchaseHistory as publicGetPurchaseHistory,\n getMeteredBillingCharges as publicGetMeteredBillingCharges,\n} from './devcenter-checkout-v1-purchased-item-billing.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { onPurchasedItemInvoiceStatusUpdated as publicOnPurchasedItemInvoiceStatusUpdated } from './devcenter-checkout-v1-purchased-item-billing.public.js';\n\nexport const getUrl: MaybeContext<\n BuildRESTFunction<typeof publicGetUrl> & typeof publicGetUrl\n> = /*#__PURE__*/ createRESTModule(publicGetUrl);\nexport const getPurchaseHistory: MaybeContext<\n BuildRESTFunction<typeof publicGetPurchaseHistory> &\n typeof publicGetPurchaseHistory\n> = /*#__PURE__*/ createRESTModule(publicGetPurchaseHistory);\n/** @internal */\nexport const getMeteredBillingCharges: MaybeContext<\n BuildRESTFunction<typeof publicGetMeteredBillingCharges> &\n typeof publicGetMeteredBillingCharges\n> = /*#__PURE__*/ createRESTModule(publicGetMeteredBillingCharges);\n/**\n * Triggered when there is an update to the payment status of an invoice.\n * Charges made using the [Custom Charges SPI](https://dev.wix.com/docs/rest/app-management/app-billing/custom-charges-service-plugin/introduction) may be based on usage.\n * Learn more about [usage-based charges](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/set-up-a-usage-based-business-model).\n */\nexport const onPurchasedItemInvoiceStatusUpdated: ReturnType<\n typeof createEventModule<typeof publicOnPurchasedItemInvoiceStatusUpdated>\n> = createEventModule(publicOnPurchasedItemInvoiceStatusUpdated);\n\nexport {\n PaymentCycle,\n InvoiceStatus,\n WebhookIdentityType,\n} from './devcenter-checkout-v1-purchased-item-billing.universal.js';\nexport {\n PurchasedItem,\n InvoiceStatusUpdated,\n GetUrlRequest,\n ChargeOverride,\n GetUrlResponse,\n GetPurchaseHistoryRequest,\n GetPurchaseHistoryResponse,\n GetSitePaymentMethodsStatusRequest,\n GetSitePaymentMethodsStatusResponse,\n GetMeteredBillingChargesRequest,\n GetMeteredBillingChargesResponse,\n Charge,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n PurchasedItemInvoiceStatusUpdatedEnvelope,\n GetUrlOptions,\n GetMeteredBillingChargesOptions,\n} from './devcenter-checkout-v1-purchased-item-billing.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,uBAAmC;;;ACD5C,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAs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AA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,WAAW;AAAA,UACX,SAAS;AAAA,QACX;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AD3hBO,SAASC,QAAO,YAAyC;AAC9D,SAAO,CAAC,WAAmB,YACzBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAuBO,SAASC,oBACd,YAC6B;AAC7B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAgBO,SAASC,0BACd,YACmC;AACnC,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAkBO,IAAM,sCAAsC;AAAA,EACjD;AAAA,EACA;AAAA,EACA,CAAC,UACCC,yCAAwC,KAAK;AACjD,EAA6C;;;AGlG7C,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAI3B,IAAMC,UAEK,iCAAiBA,OAAY;AACxC,IAAMC,sBAGK,iCAAiBA,mBAAwB;AAEpD,IAAMC,4BAGK,iCAAiBA,yBAA8B;AAM1D,IAAMC,uCAET,kBAAkB,mCAAyC;","names":["renameKeysFromRESTResponseToSDKResponse","payload","PaymentCycle","InvoiceStatus","WebhookIdentityType","getUrl","getPurchaseHistory","getMeteredBillingCharges","getUrl","getPurchaseHistory","getMeteredBillingCharges","renameKeysFromRESTResponseToSDKResponse","getUrl","getPurchaseHistory","getMeteredBillingCharges","onPurchasedItemInvoiceStatusUpdated"]}
@@ -1,4 +1,4 @@
1
- export interface PurchasedItem {
1
+ interface PurchasedItem {
2
2
  /** ID of your app's paid plan. */
3
3
  productId?: string;
4
4
  /** Price of your app's paid plan. For example, `9.95`. */
@@ -16,7 +16,7 @@ export interface PurchasedItem {
16
16
  */
17
17
  dateCreated?: Date | null;
18
18
  }
19
- export declare enum PaymentCycle {
19
+ declare enum PaymentCycle {
20
20
  NO_CYCLE = "NO_CYCLE",
21
21
  MONTHLY = "MONTHLY",
22
22
  YEARLY = "YEARLY",
@@ -26,7 +26,7 @@ export declare enum PaymentCycle {
26
26
  FOUR_YEARS = "FOUR_YEARS",
27
27
  FIVE_YEARS = "FIVE_YEARS"
28
28
  }
29
- export interface InvoiceStatusUpdated {
29
+ interface InvoiceStatusUpdated {
30
30
  /** Invoice payment status. */
31
31
  status?: InvoiceStatus;
32
32
  /**
@@ -42,7 +42,7 @@ export interface InvoiceStatusUpdated {
42
42
  /** Whether the invoice is for a single payment or for multiple, recurring payments. */
43
43
  recurring?: boolean;
44
44
  }
45
- export declare enum InvoiceStatus {
45
+ declare enum InvoiceStatus {
46
46
  UNKNOWN_INVOICE_STATUS = "UNKNOWN_INVOICE_STATUS",
47
47
  PAYMENT_FAILED = "PAYMENT_FAILED",
48
48
  PAID = "PAID",
@@ -50,7 +50,7 @@ export declare enum InvoiceStatus {
50
50
  VOIDED = "VOIDED",
51
51
  CHARGEDBACK = "CHARGEDBACK"
52
52
  }
53
- export interface GetUrlRequest {
53
+ interface GetUrlRequest {
54
54
  /**
55
55
  * ID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard
56
56
  * for a list of your app's supported product IDs.
@@ -88,7 +88,7 @@ export interface GetUrlRequest {
88
88
  /** Coupon code for the paid plan. Available only in case there is a discount. */
89
89
  couponCode?: string | null;
90
90
  }
91
- export interface ChargeOverride {
91
+ interface ChargeOverride {
92
92
  /**
93
93
  * Override price. In case you omit the override price, Wix charges site
94
94
  * owners the app's default price that's configured in the Pricing page of your app's dashboard.
@@ -100,7 +100,7 @@ export interface ChargeOverride {
100
100
  */
101
101
  currency?: string;
102
102
  }
103
- export interface GetUrlResponse {
103
+ interface GetUrlResponse {
104
104
  /**
105
105
  * URL for the Wix checkout page.
106
106
  * @format WEB_URL
@@ -113,15 +113,15 @@ export interface GetUrlResponse {
113
113
  */
114
114
  token?: string | null;
115
115
  }
116
- export interface GetPurchaseHistoryRequest {
116
+ interface GetPurchaseHistoryRequest {
117
117
  }
118
- export interface GetPurchaseHistoryResponse {
118
+ interface GetPurchaseHistoryResponse {
119
119
  /** Retrieved purchases the site owners have completed for you app. */
120
120
  purchases?: PurchasedItem[];
121
121
  }
122
- export interface GetSitePaymentMethodsStatusRequest {
122
+ interface GetSitePaymentMethodsStatusRequest {
123
123
  }
124
- export interface GetSitePaymentMethodsStatusResponse {
124
+ interface GetSitePaymentMethodsStatusResponse {
125
125
  /**
126
126
  * Whether the site owners have enabled at least a single online payment method.
127
127
  * Online payment methods include Wix Payments, Stripe, PayPal, and credit
@@ -142,7 +142,7 @@ export interface GetSitePaymentMethodsStatusResponse {
142
142
  */
143
143
  thirdPartyPosProviderEnabled?: boolean;
144
144
  }
145
- export interface GetMeteredBillingChargesRequest {
145
+ interface GetMeteredBillingChargesRequest {
146
146
  /**
147
147
  * 3-letter currency code in
148
148
  * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
@@ -160,13 +160,13 @@ export interface GetMeteredBillingChargesRequest {
160
160
  */
161
161
  endDate?: Date | null;
162
162
  }
163
- export interface GetMeteredBillingChargesResponse {
163
+ interface GetMeteredBillingChargesResponse {
164
164
  /** List of retrieved custom charges. */
165
165
  charges?: Charge[];
166
166
  }
167
- export interface Charge {
167
+ interface Charge {
168
168
  /** ID of the custom charge. The ID consists of 64 characters. */
169
- id?: string | null;
169
+ _id?: string | null;
170
170
  /** Description of the custom charge. */
171
171
  description?: string;
172
172
  /**
@@ -178,7 +178,7 @@ export interface Charge {
178
178
  */
179
179
  amount?: string;
180
180
  }
181
- export interface MessageEnvelope {
181
+ interface MessageEnvelope {
182
182
  /**
183
183
  * App instance ID.
184
184
  * @format GUID
@@ -194,7 +194,7 @@ export interface MessageEnvelope {
194
194
  /** Stringify payload. */
195
195
  data?: string;
196
196
  }
197
- export interface IdentificationData extends IdentificationDataIdOneOf {
197
+ interface IdentificationData extends IdentificationDataIdOneOf {
198
198
  /**
199
199
  * ID of a site visitor that has not logged in to the site.
200
200
  * @format GUID
@@ -219,7 +219,7 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
219
219
  identityType?: WebhookIdentityType;
220
220
  }
221
221
  /** @oneof */
222
- export interface IdentificationDataIdOneOf {
222
+ interface IdentificationDataIdOneOf {
223
223
  /**
224
224
  * ID of a site visitor that has not logged in to the site.
225
225
  * @format GUID
@@ -241,10 +241,81 @@ export interface IdentificationDataIdOneOf {
241
241
  */
242
242
  appId?: string;
243
243
  }
244
- export declare enum WebhookIdentityType {
244
+ declare enum WebhookIdentityType {
245
245
  UNKNOWN = "UNKNOWN",
246
246
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
247
247
  MEMBER = "MEMBER",
248
248
  WIX_USER = "WIX_USER",
249
249
  APP = "APP"
250
250
  }
251
+ interface BaseEventMetadata {
252
+ /**
253
+ * App instance ID.
254
+ * @format GUID
255
+ */
256
+ instanceId?: string | null;
257
+ /**
258
+ * Event type.
259
+ * @maxLength 150
260
+ */
261
+ eventType?: string;
262
+ /** The identification type and identity data. */
263
+ identity?: IdentificationData;
264
+ }
265
+ interface PurchasedItemInvoiceStatusUpdatedEnvelope {
266
+ data: InvoiceStatusUpdated;
267
+ metadata: BaseEventMetadata;
268
+ }
269
+ interface GetUrlOptions {
270
+ /**
271
+ * URL for the Wix checkout page. Redirect site owners to this URL after
272
+ * they've successfully purchased a paid plan for your app.
273
+ * @format WEB_URL
274
+ */
275
+ successUrl?: string | null;
276
+ /**
277
+ * Whether the checkout is for testing purposes only. Testing is mainly
278
+ * relevant for in-app purchase flows. When `true`, Wix charges the site
279
+ * owners an amount of `0.00`.
280
+ */
281
+ testCheckout?: boolean;
282
+ /** Information about the paid plan's billing cycle. */
283
+ billingCycle?: PaymentCycle;
284
+ /**
285
+ * 2-letter country code in
286
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
287
+ * format.
288
+ *
289
+ * Default: `"US"`
290
+ */
291
+ countryCode?: string | null;
292
+ /**
293
+ * 2-letter language code in
294
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
295
+ *
296
+ * Default: `"EN"`
297
+ */
298
+ languageCode?: string | null;
299
+ /** Coupon code for the paid plan. Available only in case there is a discount. */
300
+ couponCode?: string | null;
301
+ }
302
+ interface GetMeteredBillingChargesOptions {
303
+ /**
304
+ * 3-letter currency code in
305
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
306
+ * @format CURRENCY
307
+ */
308
+ currency?: string | null;
309
+ /**
310
+ * Start of the period you want to retrieve the custom charges for in
311
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
312
+ */
313
+ startDate?: Date | null;
314
+ /**
315
+ * End of the period you want to retrieve the custom charges for in
316
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
317
+ */
318
+ endDate?: Date | null;
319
+ }
320
+
321
+ export { type BaseEventMetadata as B, type ChargeOverride as C, type GetUrlOptions as G, InvoiceStatus as I, type MessageEnvelope as M, PaymentCycle as P, WebhookIdentityType as W, type GetUrlResponse as a, type GetPurchaseHistoryResponse as b, type GetMeteredBillingChargesOptions as c, type GetMeteredBillingChargesResponse as d, type PurchasedItem as e, type InvoiceStatusUpdated as f, type GetUrlRequest as g, type GetPurchaseHistoryRequest as h, type GetSitePaymentMethodsStatusRequest as i, type GetSitePaymentMethodsStatusResponse as j, type GetMeteredBillingChargesRequest as k, type Charge as l, type IdentificationData as m, type IdentificationDataIdOneOf as n, type PurchasedItemInvoiceStatusUpdatedEnvelope as o };