@wix/auto_sdk_app-management_billing 1.0.15 → 1.0.17

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 (121) hide show
  1. package/build/{es/src/devcenter-checkout-v1-purchased-item-billing.universal.d.ts → cjs/devcenter-checkout-v1-purchased-item-billing.universal-BOJl75V0.d.ts} +27 -87
  2. package/build/cjs/index.d.ts +47 -1
  3. package/build/cjs/index.js +356 -15
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/meta.d.ts +141 -1
  6. package/build/cjs/meta.js +237 -15
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/{cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.d.ts → es/devcenter-checkout-v1-purchased-item-billing.universal-BOJl75V0.d.mts} +27 -87
  9. package/build/es/index.d.mts +47 -0
  10. package/build/es/index.mjs +329 -0
  11. package/build/es/index.mjs.map +1 -0
  12. package/build/es/meta.d.mts +141 -0
  13. package/build/es/meta.mjs +211 -0
  14. package/build/es/meta.mjs.map +1 -0
  15. package/build/{cjs/src/devcenter-checkout-v1-purchased-item-billing.types.d.ts → internal/cjs/devcenter-checkout-v1-purchased-item-billing.universal-0VctJpJS.d.ts} +93 -22
  16. package/build/internal/cjs/index.d.ts +64 -1
  17. package/build/internal/cjs/index.js +356 -15
  18. package/build/internal/cjs/index.js.map +1 -1
  19. package/build/internal/cjs/meta.d.ts +141 -1
  20. package/build/internal/cjs/meta.js +237 -15
  21. package/build/internal/cjs/meta.js.map +1 -1
  22. package/build/{es/src/devcenter-checkout-v1-purchased-item-billing.types.d.ts → internal/es/devcenter-checkout-v1-purchased-item-billing.universal-0VctJpJS.d.mts} +93 -22
  23. package/build/internal/es/index.d.mts +64 -0
  24. package/build/internal/es/index.mjs +329 -0
  25. package/build/internal/es/index.mjs.map +1 -0
  26. package/build/internal/es/meta.d.mts +141 -0
  27. package/build/internal/es/meta.mjs +211 -0
  28. package/build/internal/es/meta.mjs.map +1 -0
  29. package/package.json +9 -8
  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/devcenter-checkout-v1-purchased-item-billing.context.d.ts +0 -14
  34. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.js +0 -22
  35. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.js.map +0 -1
  36. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.d.ts +0 -35
  37. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.js +0 -184
  38. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.js.map +0 -1
  39. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.d.ts +0 -15
  40. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.js +0 -85
  41. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.js.map +0 -1
  42. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.d.ts +0 -38
  43. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.js +0 -32
  44. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.js.map +0 -1
  45. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.js +0 -32
  46. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.js.map +0 -1
  47. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.js +0 -207
  48. package/build/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.js.map +0 -1
  49. package/build/es/index.d.ts +0 -1
  50. package/build/es/index.js +0 -2
  51. package/build/es/index.js.map +0 -1
  52. package/build/es/index.typings.d.ts +0 -1
  53. package/build/es/index.typings.js +0 -2
  54. package/build/es/index.typings.js.map +0 -1
  55. package/build/es/meta.d.ts +0 -1
  56. package/build/es/meta.js +0 -2
  57. package/build/es/meta.js.map +0 -1
  58. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.context.d.ts +0 -14
  59. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.context.js +0 -16
  60. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.context.js.map +0 -1
  61. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.http.d.ts +0 -35
  62. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.http.js +0 -178
  63. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.http.js.map +0 -1
  64. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.meta.d.ts +0 -15
  65. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.meta.js +0 -56
  66. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.meta.js.map +0 -1
  67. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.public.d.ts +0 -38
  68. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.public.js +0 -23
  69. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.public.js.map +0 -1
  70. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.types.js +0 -29
  71. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.types.js.map +0 -1
  72. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.universal.js +0 -178
  73. package/build/es/src/devcenter-checkout-v1-purchased-item-billing.universal.js.map +0 -1
  74. package/build/internal/cjs/index.typings.d.ts +0 -1
  75. package/build/internal/cjs/index.typings.js +0 -18
  76. package/build/internal/cjs/index.typings.js.map +0 -1
  77. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.d.ts +0 -16
  78. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.js +0 -22
  79. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.context.js.map +0 -1
  80. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.d.ts +0 -35
  81. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.js +0 -184
  82. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.http.js.map +0 -1
  83. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.d.ts +0 -15
  84. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.js +0 -85
  85. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.meta.js.map +0 -1
  86. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.d.ts +0 -53
  87. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.js +0 -32
  88. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.public.js.map +0 -1
  89. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.d.ts +0 -256
  90. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.js +0 -32
  91. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.types.js.map +0 -1
  92. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.d.ts +0 -407
  93. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.js +0 -207
  94. package/build/internal/cjs/src/devcenter-checkout-v1-purchased-item-billing.universal.js.map +0 -1
  95. package/build/internal/es/index.d.ts +0 -1
  96. package/build/internal/es/index.js +0 -2
  97. package/build/internal/es/index.js.map +0 -1
  98. package/build/internal/es/index.typings.d.ts +0 -1
  99. package/build/internal/es/index.typings.js +0 -2
  100. package/build/internal/es/index.typings.js.map +0 -1
  101. package/build/internal/es/meta.d.ts +0 -1
  102. package/build/internal/es/meta.js +0 -2
  103. package/build/internal/es/meta.js.map +0 -1
  104. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.context.d.ts +0 -16
  105. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.context.js +0 -16
  106. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.context.js.map +0 -1
  107. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.http.d.ts +0 -35
  108. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.http.js +0 -178
  109. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.http.js.map +0 -1
  110. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.meta.d.ts +0 -15
  111. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.meta.js +0 -56
  112. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.meta.js.map +0 -1
  113. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.public.d.ts +0 -53
  114. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.public.js +0 -23
  115. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.public.js.map +0 -1
  116. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.types.d.ts +0 -256
  117. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.types.js +0 -29
  118. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.types.js.map +0 -1
  119. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.universal.d.ts +0 -407
  120. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.universal.js +0 -178
  121. package/build/internal/es/src/devcenter-checkout-v1-purchased-item-billing.universal.js.map +0 -1
@@ -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",
@@ -27,8 +27,8 @@ export declare enum PaymentCycle {
27
27
  FIVE_YEARS = "FIVE_YEARS"
28
28
  }
29
29
  /** @enumType */
30
- export type PaymentCycleWithLiterals = PaymentCycle | 'NO_CYCLE' | 'MONTHLY' | 'YEARLY' | 'ONE_TIME' | 'TWO_YEARS' | 'THREE_YEARS' | 'FOUR_YEARS' | 'FIVE_YEARS';
31
- export interface InvoiceStatusUpdated {
30
+ type PaymentCycleWithLiterals = PaymentCycle | 'NO_CYCLE' | 'MONTHLY' | 'YEARLY' | 'ONE_TIME' | 'TWO_YEARS' | 'THREE_YEARS' | 'FOUR_YEARS' | 'FIVE_YEARS';
31
+ interface InvoiceStatusUpdated {
32
32
  /** Invoice payment status. */
33
33
  status?: InvoiceStatusWithLiterals;
34
34
  /**
@@ -44,7 +44,7 @@ export interface InvoiceStatusUpdated {
44
44
  /** Whether the invoice is for a single payment or for multiple, recurring payments. */
45
45
  recurring?: boolean;
46
46
  }
47
- export declare enum InvoiceStatus {
47
+ declare enum InvoiceStatus {
48
48
  UNKNOWN_INVOICE_STATUS = "UNKNOWN_INVOICE_STATUS",
49
49
  PAYMENT_FAILED = "PAYMENT_FAILED",
50
50
  PAID = "PAID",
@@ -53,8 +53,8 @@ export declare enum InvoiceStatus {
53
53
  CHARGEDBACK = "CHARGEDBACK"
54
54
  }
55
55
  /** @enumType */
56
- export type InvoiceStatusWithLiterals = InvoiceStatus | 'UNKNOWN_INVOICE_STATUS' | 'PAYMENT_FAILED' | 'PAID' | 'REFUNDED' | 'VOIDED' | 'CHARGEDBACK';
57
- export interface GetUrlRequest {
56
+ type InvoiceStatusWithLiterals = InvoiceStatus | 'UNKNOWN_INVOICE_STATUS' | 'PAYMENT_FAILED' | 'PAID' | 'REFUNDED' | 'VOIDED' | 'CHARGEDBACK';
57
+ interface GetUrlRequest {
58
58
  /**
59
59
  * ID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard
60
60
  * for a list of your app's supported product IDs.
@@ -92,7 +92,7 @@ export interface GetUrlRequest {
92
92
  /** Coupon code for the paid plan. Available only in case there is a discount. */
93
93
  couponCode?: string | null;
94
94
  }
95
- export interface ChargeOverride {
95
+ interface ChargeOverride {
96
96
  /**
97
97
  * Override price. In case you omit the override price, Wix charges site
98
98
  * owners the app's default price that's configured in the Pricing page of your app's dashboard.
@@ -104,7 +104,7 @@ export interface ChargeOverride {
104
104
  */
105
105
  currency?: string;
106
106
  }
107
- export interface GetUrlResponse {
107
+ interface GetUrlResponse {
108
108
  /**
109
109
  * URL for the Wix checkout page.
110
110
  * @format WEB_URL
@@ -117,15 +117,15 @@ export interface GetUrlResponse {
117
117
  */
118
118
  token?: string | null;
119
119
  }
120
- export interface GetPurchaseHistoryRequest {
120
+ interface GetPurchaseHistoryRequest {
121
121
  }
122
- export interface GetPurchaseHistoryResponse {
122
+ interface GetPurchaseHistoryResponse {
123
123
  /** Retrieved purchases the site owners have completed for you app. */
124
124
  purchases?: PurchasedItem[];
125
125
  }
126
- export interface GetSitePaymentMethodsStatusRequest {
126
+ interface GetSitePaymentMethodsStatusRequest {
127
127
  }
128
- export interface GetSitePaymentMethodsStatusResponse {
128
+ interface GetSitePaymentMethodsStatusResponse {
129
129
  /**
130
130
  * Whether the site owners have enabled at least a single online payment method.
131
131
  * Online payment methods include Wix Payments, Stripe, PayPal, and credit
@@ -146,7 +146,7 @@ export interface GetSitePaymentMethodsStatusResponse {
146
146
  */
147
147
  thirdPartyPosProviderEnabled?: boolean;
148
148
  }
149
- export interface GetMeteredBillingChargesRequest {
149
+ interface GetMeteredBillingChargesRequest {
150
150
  /**
151
151
  * 3-letter currency code in
152
152
  * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
@@ -164,13 +164,13 @@ export interface GetMeteredBillingChargesRequest {
164
164
  */
165
165
  endDate?: Date | null;
166
166
  }
167
- export interface GetMeteredBillingChargesResponse {
167
+ interface GetMeteredBillingChargesResponse {
168
168
  /** List of retrieved custom charges. */
169
169
  charges?: Charge[];
170
170
  }
171
- export interface Charge {
171
+ interface Charge {
172
172
  /** ID of the custom charge. The ID consists of 64 characters. */
173
- id?: string | null;
173
+ _id?: string | null;
174
174
  /** Description of the custom charge. */
175
175
  description?: string;
176
176
  /**
@@ -182,7 +182,7 @@ export interface Charge {
182
182
  */
183
183
  amount?: string;
184
184
  }
185
- export interface MessageEnvelope {
185
+ interface MessageEnvelope {
186
186
  /**
187
187
  * App instance ID.
188
188
  * @format GUID
@@ -198,7 +198,7 @@ export interface MessageEnvelope {
198
198
  /** Stringify payload. */
199
199
  data?: string;
200
200
  }
201
- export interface IdentificationData extends IdentificationDataIdOneOf {
201
+ interface IdentificationData extends IdentificationDataIdOneOf {
202
202
  /**
203
203
  * ID of a site visitor that has not logged in to the site.
204
204
  * @format GUID
@@ -223,7 +223,7 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
223
223
  identityType?: WebhookIdentityTypeWithLiterals;
224
224
  }
225
225
  /** @oneof */
226
- export interface IdentificationDataIdOneOf {
226
+ interface IdentificationDataIdOneOf {
227
227
  /**
228
228
  * ID of a site visitor that has not logged in to the site.
229
229
  * @format GUID
@@ -245,7 +245,7 @@ export interface IdentificationDataIdOneOf {
245
245
  */
246
246
  appId?: string;
247
247
  }
248
- export declare enum WebhookIdentityType {
248
+ declare enum WebhookIdentityType {
249
249
  UNKNOWN = "UNKNOWN",
250
250
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
251
251
  MEMBER = "MEMBER",
@@ -253,4 +253,75 @@ export declare enum WebhookIdentityType {
253
253
  APP = "APP"
254
254
  }
255
255
  /** @enumType */
256
- export type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
256
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
257
+ interface BaseEventMetadata {
258
+ /**
259
+ * App instance ID.
260
+ * @format GUID
261
+ */
262
+ instanceId?: string | null;
263
+ /**
264
+ * Event type.
265
+ * @maxLength 150
266
+ */
267
+ eventType?: string;
268
+ /** The identification type and identity data. */
269
+ identity?: IdentificationData;
270
+ }
271
+ interface PurchasedItemInvoiceStatusUpdatedEnvelope {
272
+ data: InvoiceStatusUpdated;
273
+ metadata: BaseEventMetadata;
274
+ }
275
+ interface GetUrlOptions {
276
+ /**
277
+ * URL for the Wix checkout page. Redirect site owners to this URL after
278
+ * they've successfully purchased a paid plan for your app.
279
+ * @format WEB_URL
280
+ */
281
+ successUrl?: string | null;
282
+ /**
283
+ * Whether the checkout is for testing purposes only. Testing is mainly
284
+ * relevant for in-app purchase flows. When `true`, Wix charges the site
285
+ * owners an amount of `0.00`.
286
+ */
287
+ testCheckout?: boolean;
288
+ /** Information about the paid plan's billing cycle. */
289
+ billingCycle?: PaymentCycleWithLiterals;
290
+ /**
291
+ * 2-letter country code in
292
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
293
+ * format.
294
+ *
295
+ * Default: `"US"`
296
+ */
297
+ countryCode?: string | null;
298
+ /**
299
+ * 2-letter language code in
300
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
301
+ *
302
+ * Default: `"EN"`
303
+ */
304
+ languageCode?: string | null;
305
+ /** Coupon code for the paid plan. Available only in case there is a discount. */
306
+ couponCode?: string | null;
307
+ }
308
+ interface GetMeteredBillingChargesOptions {
309
+ /**
310
+ * 3-letter currency code in
311
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
312
+ * @format CURRENCY
313
+ */
314
+ currency?: string | null;
315
+ /**
316
+ * Start of the period you want to retrieve the custom charges for in
317
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
318
+ */
319
+ startDate?: Date | null;
320
+ /**
321
+ * End of the period you want to retrieve the custom charges for in
322
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
323
+ */
324
+ endDate?: Date | null;
325
+ }
326
+
327
+ export { type BaseEventMetadata as B, type ChargeOverride as C, type GetUrlOptions as G, InvoiceStatus as I, type MessageEnvelope as M, type PurchasedItemInvoiceStatusUpdatedEnvelope as P, WebhookIdentityType as W, type GetUrlResponse as a, type GetPurchaseHistoryResponse as b, type GetMeteredBillingChargesOptions as c, type GetMeteredBillingChargesResponse as d, PaymentCycle as e, type PurchasedItem as f, type InvoiceStatusUpdated as g, type GetUrlRequest as h, type GetPurchaseHistoryRequest as i, type GetSitePaymentMethodsStatusRequest as j, type GetSitePaymentMethodsStatusResponse as k, type GetMeteredBillingChargesRequest as l, type Charge as m, type IdentificationData as n, type IdentificationDataIdOneOf as o };
@@ -1 +1,64 @@
1
- export * from './src/devcenter-checkout-v1-purchased-item-billing.context.js';
1
+ import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { G as GetUrlOptions, a as GetUrlResponse, b as GetPurchaseHistoryResponse, c as GetMeteredBillingChargesOptions, d as GetMeteredBillingChargesResponse, P as PurchasedItemInvoiceStatusUpdatedEnvelope } from './devcenter-checkout-v1-purchased-item-billing.universal-0VctJpJS.js';
3
+ export { B as BaseEventMetadata, m as Charge, C as ChargeOverride, l as GetMeteredBillingChargesRequest, i as GetPurchaseHistoryRequest, j as GetSitePaymentMethodsStatusRequest, k as GetSitePaymentMethodsStatusResponse, h as GetUrlRequest, n as IdentificationData, o as IdentificationDataIdOneOf, I as InvoiceStatus, g as InvoiceStatusUpdated, M as MessageEnvelope, e as PaymentCycle, f as PurchasedItem, W as WebhookIdentityType } from './devcenter-checkout-v1-purchased-item-billing.universal-0VctJpJS.js';
4
+
5
+ declare function getUrl$1(httpClient: HttpClient): GetUrlSignature;
6
+ interface GetUrlSignature {
7
+ /**
8
+ * Retrieves the URL for a Wix checkout page for the specified paid plan of your app.
9
+ *
10
+ *
11
+ * This call succeeds only in case you have previously
12
+ * [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).
13
+ *
14
+ * The returned checkout URL is valid for 48 hours.
15
+ *
16
+ * This API allows your app to manage your pricing page outside of Wix while
17
+ * still using the standard Wix checkout flow.
18
+ * @param - ID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard
19
+ * for a list of your app's supported product IDs.
20
+ */
21
+ (productId: string, options?: GetUrlOptions | undefined): Promise<GetUrlResponse>;
22
+ }
23
+ declare function getPurchaseHistory$1(httpClient: HttpClient): GetPurchaseHistorySignature;
24
+ interface GetPurchaseHistorySignature {
25
+ /**
26
+ * Retrieves a list of the site owner's past purchases for your app.
27
+ *
28
+ *
29
+ * You don't have to explicitly pass an identifier for the Wix site as part of
30
+ * the request, since this information is taken automatically from the context.
31
+ *
32
+ * The response doesn't include any details about cancellations.
33
+ */
34
+ (): Promise<GetPurchaseHistoryResponse>;
35
+ }
36
+ /** @internal */
37
+ declare function getMeteredBillingCharges$1(httpClient: HttpClient): GetMeteredBillingChargesSignature;
38
+ interface GetMeteredBillingChargesSignature {
39
+ /**
40
+ * Triggers Wix to call the
41
+ * [List Custom Charges SPI](https://dev.wix.com/docs/rest/internal-only/premium/custom-charges-spi/custom-charges-provider-v1/list-charges).
42
+ *
43
+ *
44
+ * Wix doesn't use the response from _List Charges_ SPI to actually create an
45
+ * invoice that's sent to the customer. Instead, calling _Get Metered Billing Charges_
46
+ * allows you confirm that your integration with the Custom Charges SPI is
47
+ * working as intended.
48
+ */
49
+ (options?: GetMeteredBillingChargesOptions | undefined): Promise<GetMeteredBillingChargesResponse>;
50
+ }
51
+ declare const onPurchasedItemInvoiceStatusUpdated$1: EventDefinition<PurchasedItemInvoiceStatusUpdatedEnvelope, "InvoiceStatusUpdated">;
52
+
53
+ declare const getUrl: MaybeContext<BuildRESTFunction<typeof getUrl$1> & typeof getUrl$1>;
54
+ declare const getPurchaseHistory: MaybeContext<BuildRESTFunction<typeof getPurchaseHistory$1> & typeof getPurchaseHistory$1>;
55
+ /** @internal */
56
+ declare const getMeteredBillingCharges: MaybeContext<BuildRESTFunction<typeof getMeteredBillingCharges$1> & typeof getMeteredBillingCharges$1>;
57
+ /**
58
+ * Triggered when there is an update to the payment status of an invoice.
59
+ * 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.
60
+ * 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).
61
+ */
62
+ declare const onPurchasedItemInvoiceStatusUpdated: BuildEventDefinition<typeof onPurchasedItemInvoiceStatusUpdated$1>;
63
+
64
+ export { GetMeteredBillingChargesOptions, GetMeteredBillingChargesResponse, GetPurchaseHistoryResponse, GetUrlOptions, GetUrlResponse, PurchasedItemInvoiceStatusUpdatedEnvelope, getMeteredBillingCharges, getPurchaseHistory, getUrl, onPurchasedItemInvoiceStatusUpdated };
@@ -1,18 +1,359 @@
1
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
15
9
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/devcenter-checkout-v1-purchased-item-billing.context.js"), exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ InvoiceStatus: () => InvoiceStatus,
24
+ PaymentCycle: () => PaymentCycle,
25
+ WebhookIdentityType: () => WebhookIdentityType,
26
+ getMeteredBillingCharges: () => getMeteredBillingCharges4,
27
+ getPurchaseHistory: () => getPurchaseHistory4,
28
+ getUrl: () => getUrl4,
29
+ onPurchasedItemInvoiceStatusUpdated: () => onPurchasedItemInvoiceStatusUpdated2
30
+ });
31
+ module.exports = __toCommonJS(index_exports);
32
+
33
+ // src/devcenter-checkout-v1-purchased-item-billing.public.ts
34
+ var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
35
+ var import_sdk_types = require("@wix/sdk-types");
36
+
37
+ // src/devcenter-checkout-v1-purchased-item-billing.universal.ts
38
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
39
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
40
+
41
+ // src/devcenter-checkout-v1-purchased-item-billing.http.ts
42
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
43
+ var import_float = require("@wix/sdk-runtime/transformations/float");
44
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
45
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
46
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
47
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
48
+ function resolveComWixpressMarketAimApiCheckoutUrl(opts) {
49
+ const domainToMappings = {
50
+ "api._api_base_domain_": [
51
+ {
52
+ srcPath: "/app-instance-manager-webapp",
53
+ destPath: ""
54
+ }
55
+ ],
56
+ "www.wixapis.com": [
57
+ {
58
+ srcPath: "/apps",
59
+ destPath: ""
60
+ }
61
+ ],
62
+ "wixapis.com": [
63
+ {
64
+ srcPath: "/apps",
65
+ destPath: ""
66
+ }
67
+ ],
68
+ "dev._base_domain_": [
69
+ {
70
+ srcPath: "/_api/app-instance-manager",
71
+ destPath: ""
72
+ },
73
+ {
74
+ srcPath: "/api/v1/instance",
75
+ destPath: "/v1/instance"
76
+ },
77
+ {
78
+ srcPath: "/api/v1/scripts",
79
+ destPath: "/v1/scripts"
80
+ }
81
+ ],
82
+ "manage._base_domain_": [
83
+ {
84
+ srcPath: "/_api/app-instance-manager",
85
+ destPath: ""
86
+ }
87
+ ],
88
+ "www._base_domain_": [
89
+ {
90
+ srcPath: "/_api/app-instance-manager",
91
+ destPath: ""
92
+ }
93
+ ],
94
+ "editor._base_domain_": [
95
+ {
96
+ srcPath: "/_api/app-instance-manager",
97
+ destPath: ""
98
+ }
99
+ ],
100
+ "blocks._base_domain_": [
101
+ {
102
+ srcPath: "/_api/app-instance-manager",
103
+ destPath: ""
104
+ }
105
+ ],
106
+ "create.editorx": [
107
+ {
108
+ srcPath: "/_api/app-instance-manager",
109
+ destPath: ""
110
+ }
111
+ ]
112
+ };
113
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
114
+ }
115
+ var PACKAGE_NAME = "@wix/auto_sdk_app-management_billing";
116
+ function getUrl(payload) {
117
+ function __getUrl({ host }) {
118
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
119
+ {
120
+ transformFn: import_float.transformSDKFloatToRESTFloat,
121
+ paths: [{ path: "chargeOverride.price" }]
122
+ }
123
+ ]);
124
+ const metadata = {
125
+ entityFqdn: "wix.devcenter.checkout.v1.purchased_item",
126
+ method: "POST",
127
+ methodFqn: "com.wixpress.market.aim.api.Checkout.GetUrl",
128
+ packageName: PACKAGE_NAME,
129
+ url: resolveComWixpressMarketAimApiCheckoutUrl({
130
+ protoPath: "/v1/checkout",
131
+ data: serializedData,
132
+ host
133
+ }),
134
+ data: serializedData
135
+ };
136
+ return metadata;
137
+ }
138
+ return __getUrl;
139
+ }
140
+ function getPurchaseHistory(payload) {
141
+ function __getPurchaseHistory({ host }) {
142
+ const metadata = {
143
+ entityFqdn: "wix.devcenter.checkout.v1.purchased_item",
144
+ method: "GET",
145
+ methodFqn: "com.wixpress.market.aim.api.Checkout.GetPurchaseHistory",
146
+ packageName: PACKAGE_NAME,
147
+ url: resolveComWixpressMarketAimApiCheckoutUrl({
148
+ protoPath: "/v1/checkout/history",
149
+ data: payload,
150
+ host
151
+ }),
152
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
153
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
154
+ {
155
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
156
+ paths: [{ path: "purchases.dateCreated" }]
157
+ }
158
+ ])
159
+ };
160
+ return metadata;
161
+ }
162
+ return __getPurchaseHistory;
163
+ }
164
+ function getMeteredBillingCharges(payload) {
165
+ function __getMeteredBillingCharges({ host }) {
166
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
167
+ {
168
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
169
+ paths: [{ path: "startDate" }, { path: "endDate" }]
170
+ }
171
+ ]);
172
+ const metadata = {
173
+ entityFqdn: "wix.devcenter.checkout.v1.purchased_item",
174
+ method: "GET",
175
+ methodFqn: "com.wixpress.market.aim.api.Checkout.GetMeteredBillingCharges",
176
+ packageName: PACKAGE_NAME,
177
+ url: resolveComWixpressMarketAimApiCheckoutUrl({
178
+ protoPath: "/v1/metered-billing-charges",
179
+ data: serializedData,
180
+ host
181
+ }),
182
+ params: (0, import_rest_modules.toURLSearchParams)(serializedData)
183
+ };
184
+ return metadata;
185
+ }
186
+ return __getMeteredBillingCharges;
187
+ }
188
+
189
+ // src/devcenter-checkout-v1-purchased-item-billing.universal.ts
190
+ var PaymentCycle = /* @__PURE__ */ ((PaymentCycle2) => {
191
+ PaymentCycle2["NO_CYCLE"] = "NO_CYCLE";
192
+ PaymentCycle2["MONTHLY"] = "MONTHLY";
193
+ PaymentCycle2["YEARLY"] = "YEARLY";
194
+ PaymentCycle2["ONE_TIME"] = "ONE_TIME";
195
+ PaymentCycle2["TWO_YEARS"] = "TWO_YEARS";
196
+ PaymentCycle2["THREE_YEARS"] = "THREE_YEARS";
197
+ PaymentCycle2["FOUR_YEARS"] = "FOUR_YEARS";
198
+ PaymentCycle2["FIVE_YEARS"] = "FIVE_YEARS";
199
+ return PaymentCycle2;
200
+ })(PaymentCycle || {});
201
+ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
202
+ InvoiceStatus2["UNKNOWN_INVOICE_STATUS"] = "UNKNOWN_INVOICE_STATUS";
203
+ InvoiceStatus2["PAYMENT_FAILED"] = "PAYMENT_FAILED";
204
+ InvoiceStatus2["PAID"] = "PAID";
205
+ InvoiceStatus2["REFUNDED"] = "REFUNDED";
206
+ InvoiceStatus2["VOIDED"] = "VOIDED";
207
+ InvoiceStatus2["CHARGEDBACK"] = "CHARGEDBACK";
208
+ return InvoiceStatus2;
209
+ })(InvoiceStatus || {});
210
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
211
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
212
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
213
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
214
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
215
+ WebhookIdentityType2["APP"] = "APP";
216
+ return WebhookIdentityType2;
217
+ })(WebhookIdentityType || {});
218
+ async function getUrl2(productId, options) {
219
+ const { httpClient, sideEffects } = arguments[2];
220
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
221
+ productId,
222
+ successUrl: options?.successUrl,
223
+ testCheckout: options?.testCheckout,
224
+ billingCycle: options?.billingCycle,
225
+ countryCode: options?.countryCode,
226
+ languageCode: options?.languageCode,
227
+ couponCode: options?.couponCode
228
+ });
229
+ const reqOpts = getUrl(payload);
230
+ sideEffects?.onSiteCall?.();
231
+ try {
232
+ const result = await httpClient.request(reqOpts);
233
+ sideEffects?.onSuccess?.(result);
234
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
235
+ } catch (err) {
236
+ const transformedError = (0, import_transform_error.transformError)(
237
+ err,
238
+ {
239
+ spreadPathsToArguments: {},
240
+ explicitPathsToArguments: {
241
+ productId: "$[0]",
242
+ successUrl: "$[1].successUrl",
243
+ testCheckout: "$[1].testCheckout",
244
+ billingCycle: "$[1].billingCycle",
245
+ countryCode: "$[1].countryCode",
246
+ languageCode: "$[1].languageCode",
247
+ couponCode: "$[1].couponCode"
248
+ },
249
+ singleArgumentUnchanged: false
250
+ },
251
+ ["productId", "options"]
252
+ );
253
+ sideEffects?.onError?.(err);
254
+ throw transformedError;
255
+ }
256
+ }
257
+ async function getPurchaseHistory2() {
258
+ const { httpClient, sideEffects } = arguments[0];
259
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
260
+ const reqOpts = getPurchaseHistory(payload);
261
+ sideEffects?.onSiteCall?.();
262
+ try {
263
+ const result = await httpClient.request(reqOpts);
264
+ sideEffects?.onSuccess?.(result);
265
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
266
+ } catch (err) {
267
+ const transformedError = (0, import_transform_error.transformError)(
268
+ err,
269
+ {
270
+ spreadPathsToArguments: {},
271
+ explicitPathsToArguments: {},
272
+ singleArgumentUnchanged: false
273
+ },
274
+ []
275
+ );
276
+ sideEffects?.onError?.(err);
277
+ throw transformedError;
278
+ }
279
+ }
280
+ async function getMeteredBillingCharges2(options) {
281
+ const { httpClient, sideEffects } = arguments[1];
282
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
283
+ currency: options?.currency,
284
+ startDate: options?.startDate,
285
+ endDate: options?.endDate
286
+ });
287
+ const reqOpts = getMeteredBillingCharges(
288
+ payload
289
+ );
290
+ sideEffects?.onSiteCall?.();
291
+ try {
292
+ const result = await httpClient.request(reqOpts);
293
+ sideEffects?.onSuccess?.(result);
294
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
295
+ } catch (err) {
296
+ const transformedError = (0, import_transform_error.transformError)(
297
+ err,
298
+ {
299
+ spreadPathsToArguments: {},
300
+ explicitPathsToArguments: {
301
+ currency: "$[0].currency",
302
+ startDate: "$[0].startDate",
303
+ endDate: "$[0].endDate"
304
+ },
305
+ singleArgumentUnchanged: false
306
+ },
307
+ ["options"]
308
+ );
309
+ sideEffects?.onError?.(err);
310
+ throw transformedError;
311
+ }
312
+ }
313
+
314
+ // src/devcenter-checkout-v1-purchased-item-billing.public.ts
315
+ function getUrl3(httpClient) {
316
+ return (productId, options) => getUrl2(
317
+ productId,
318
+ options,
319
+ // @ts-ignore
320
+ { httpClient }
321
+ );
322
+ }
323
+ function getPurchaseHistory3(httpClient) {
324
+ return () => getPurchaseHistory2(
325
+ // @ts-ignore
326
+ { httpClient }
327
+ );
328
+ }
329
+ function getMeteredBillingCharges3(httpClient) {
330
+ return (options) => getMeteredBillingCharges2(
331
+ options,
332
+ // @ts-ignore
333
+ { httpClient }
334
+ );
335
+ }
336
+ var onPurchasedItemInvoiceStatusUpdated = (0, import_sdk_types.EventDefinition)(
337
+ "InvoiceStatusUpdated",
338
+ false,
339
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(event)
340
+ )();
341
+
342
+ // src/devcenter-checkout-v1-purchased-item-billing.context.ts
343
+ var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
344
+ var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
345
+ var getUrl4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getUrl3);
346
+ var getPurchaseHistory4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPurchaseHistory3);
347
+ var getMeteredBillingCharges4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getMeteredBillingCharges3);
348
+ var onPurchasedItemInvoiceStatusUpdated2 = (0, import_event_definition_modules.createEventModule)(onPurchasedItemInvoiceStatusUpdated);
349
+ // Annotate the CommonJS export names for ESM import in node:
350
+ 0 && (module.exports = {
351
+ InvoiceStatus,
352
+ PaymentCycle,
353
+ WebhookIdentityType,
354
+ getMeteredBillingCharges,
355
+ getPurchaseHistory,
356
+ getUrl,
357
+ onPurchasedItemInvoiceStatusUpdated
358
+ });
18
359
  //# sourceMappingURL=index.js.map