@wix/auto_sdk_app-management_custom-charges 1.0.11 → 1.0.13

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 (65) hide show
  1. package/build/cjs/index.d.ts +427 -2
  2. package/build/cjs/index.js +147 -16
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/{cjs/src/service-plugins-types.d.ts → es/index.d.mts} +105 -21
  5. package/build/es/index.mjs +122 -0
  6. package/build/es/index.mjs.map +1 -0
  7. package/build/internal/cjs/index.d.ts +427 -2
  8. package/build/internal/cjs/index.js +147 -16
  9. package/build/internal/cjs/index.js.map +1 -1
  10. package/build/{es/src/service-plugins-types.d.ts → internal/es/index.d.mts} +105 -21
  11. package/build/internal/es/index.mjs +122 -0
  12. package/build/internal/es/index.mjs.map +1 -0
  13. package/package.json +9 -8
  14. package/build/cjs/index.typings.d.ts +0 -59
  15. package/build/cjs/index.typings.js +0 -18
  16. package/build/cjs/index.typings.js.map +0 -1
  17. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
  18. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -9
  19. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
  20. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
  21. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -88
  22. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
  23. package/build/cjs/src/service-plugins-types.js +0 -30
  24. package/build/cjs/src/service-plugins-types.js.map +0 -1
  25. package/build/es/index.d.ts +0 -2
  26. package/build/es/index.js +0 -3
  27. package/build/es/index.js.map +0 -1
  28. package/build/es/index.typings.d.ts +0 -59
  29. package/build/es/index.typings.js +0 -2
  30. package/build/es/index.typings.js.map +0 -1
  31. package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
  32. package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -6
  33. package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
  34. package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
  35. package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -85
  36. package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
  37. package/build/es/src/service-plugins-types.js +0 -27
  38. package/build/es/src/service-plugins-types.js.map +0 -1
  39. package/build/internal/cjs/index.typings.d.ts +0 -59
  40. package/build/internal/cjs/index.typings.js +0 -18
  41. package/build/internal/cjs/index.typings.js.map +0 -1
  42. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
  43. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -9
  44. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
  45. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
  46. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -88
  47. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
  48. package/build/internal/cjs/src/service-plugins-types.d.ts +0 -343
  49. package/build/internal/cjs/src/service-plugins-types.js +0 -30
  50. package/build/internal/cjs/src/service-plugins-types.js.map +0 -1
  51. package/build/internal/es/index.d.ts +0 -2
  52. package/build/internal/es/index.js +0 -3
  53. package/build/internal/es/index.js.map +0 -1
  54. package/build/internal/es/index.typings.d.ts +0 -59
  55. package/build/internal/es/index.typings.js +0 -2
  56. package/build/internal/es/index.typings.js.map +0 -1
  57. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
  58. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -6
  59. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
  60. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
  61. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -85
  62. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
  63. package/build/internal/es/src/service-plugins-types.d.ts +0 -343
  64. package/build/internal/es/src/service-plugins-types.js +0 -27
  65. package/build/internal/es/src/service-plugins-types.js.map +0 -1
@@ -1,4 +1,6 @@
1
- export interface GetChargeLimitRequest {
1
+ import { ServicePluginDefinition, BuildServicePluginDefinition } from '@wix/sdk-types';
2
+
3
+ interface GetChargeLimitRequest {
2
4
  /**
3
5
  * ID of the subscription for which Wix retrieves the charge limit. Equals
4
6
  * `null` in case Wix hasn't created the subscription when retrieving an
@@ -17,7 +19,7 @@ export interface GetChargeLimitRequest {
17
19
  */
18
20
  currency?: string;
19
21
  }
20
- export interface GetChargeLimitResponse {
22
+ interface GetChargeLimitResponse {
21
23
  /**
22
24
  * Retrieved charge limit for the app instance. You can't update the
23
25
  * charge limit after you've set an initial value. Site owners can increase the
@@ -27,7 +29,7 @@ export interface GetChargeLimitResponse {
27
29
  */
28
30
  chargeLimit?: string | null;
29
31
  }
30
- export interface ListChargesRequest {
32
+ interface ListChargesRequest {
31
33
  /**
32
34
  * ID of the subscription for which Wix retrieves your custom charges.
33
35
  * To track usage and billing for apps, we recommend to use `instanceId` instead
@@ -57,13 +59,13 @@ export interface ListChargesRequest {
57
59
  /** Information about what Wix intends to do with the retrieved charges. */
58
60
  intent?: Intent;
59
61
  }
60
- export declare enum Intent {
62
+ declare enum Intent {
61
63
  /** Inform the customer about how much your app would charge them at the moment. Wix doesn't create an invoice. */
62
64
  DISPLAY_ONLY = "DISPLAY_ONLY",
63
65
  /** Create an invoice for the customer. */
64
66
  CREATE_INVOICE = "CREATE_INVOICE"
65
67
  }
66
- export interface ListChargesResponse {
68
+ interface ListChargesResponse {
67
69
  /**
68
70
  * Retrieved charges.
69
71
  *
@@ -72,7 +74,7 @@ export interface ListChargesResponse {
72
74
  */
73
75
  charges?: ChargeLineItem[];
74
76
  }
75
- export interface ChargeLineItem {
77
+ interface ChargeLineItem {
76
78
  /**
77
79
  * ID of the charge. Make sure to save the charge ID on your servers for future
78
80
  * reference. Identical to `lineItem.chargeId` in the Invoice Created Event.
@@ -95,7 +97,7 @@ export interface ChargeLineItem {
95
97
  */
96
98
  amount?: string;
97
99
  }
98
- export interface ChargesRejectedRequest {
100
+ interface ChargesRejectedRequest {
99
101
  /**
100
102
  * ID of the subscription for which Wix hasn't accepted your custom charges.
101
103
  * To track usage and billing for apps, we recommend to use `instanceId` instead
@@ -135,7 +137,7 @@ export interface ChargesRejectedRequest {
135
137
  */
136
138
  reasons?: ChargesRejectedReason[];
137
139
  }
138
- export declare enum ChargesRejectedReason {
140
+ declare enum ChargesRejectedReason {
139
141
  /** There is no information about why Wix has rejected the charges. */
140
142
  UNKNOWN = "UNKNOWN",
141
143
  /** The sum of the charges is higher than the limit that you may charge the customer per billing cycle. */
@@ -145,9 +147,9 @@ export declare enum ChargesRejectedReason {
145
147
  /** You must submit charges as whole numbers or use a dot to separate major and minor units. For example, `10` or `1.50`. Currently, Wix doesn't validate whether the submitted number of decimals for the minor unit is supported for the given currency. */
146
148
  INVALID_FORMAT = "INVALID_FORMAT"
147
149
  }
148
- export interface ChargesRejectedResponse {
150
+ interface ChargesRejectedResponse {
149
151
  }
150
- export interface InvoiceCreatedRequest {
152
+ interface InvoiceCreatedRequest {
151
153
  /**
152
154
  * ID of the subscription for which Wix has created an invoice that includes
153
155
  * your custom charges. To track usage and billing for apps, we recommend to use
@@ -172,7 +174,7 @@ export interface InvoiceCreatedRequest {
172
174
  */
173
175
  lineItems?: InvoiceLineItem[];
174
176
  }
175
- export interface InvoiceLineItem {
177
+ interface InvoiceLineItem {
176
178
  /**
177
179
  * ID of the charge as returned in List Charges.
178
180
  *
@@ -191,9 +193,9 @@ export interface InvoiceLineItem {
191
193
  */
192
194
  _id?: string;
193
195
  }
194
- export interface InvoiceCreatedResponse {
196
+ interface InvoiceCreatedResponse {
195
197
  }
196
- export interface ChargeLimitUpdatedRequest {
198
+ interface ChargeLimitUpdatedRequest {
197
199
  /**
198
200
  * ID of the subscription for which the charge limit has been updated.
199
201
  * To track usage and billing for apps, we recommend to use `instanceId` instead
@@ -216,9 +218,9 @@ export interface ChargeLimitUpdatedRequest {
216
218
  */
217
219
  chargeLimit?: string | null;
218
220
  }
219
- export interface ChargeLimitUpdatedResponse {
221
+ interface ChargeLimitUpdatedResponse {
220
222
  }
221
- export interface CustomChargesConfig {
223
+ interface CustomChargesConfig {
222
224
  /**
223
225
  * Base part of your integration's deployment URI for the Custom Charges SPI.
224
226
  * For example `"https://provider.example.com"`, if Wix should call your
@@ -227,7 +229,7 @@ export interface CustomChargesConfig {
227
229
  */
228
230
  baseUri?: SpiBaseUri;
229
231
  }
230
- export interface SpiBaseUri {
232
+ interface SpiBaseUri {
231
233
  /**
232
234
  * Base URI where the methods are called. Wix appends the path to the `baseUri`.
233
235
  * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.
@@ -238,7 +240,7 @@ export interface SpiBaseUri {
238
240
  /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */
239
241
  alternativeUris?: AlternativeUri[];
240
242
  }
241
- export interface AlternativeUri {
243
+ interface AlternativeUri {
242
244
  /**
243
245
  * Name of the method to create a custom URI for.
244
246
  *
@@ -269,7 +271,7 @@ export interface AlternativeUri {
269
271
  * }
270
272
  * ```
271
273
  */
272
- export interface Context {
274
+ interface Context {
273
275
  /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */
274
276
  requestId?: string | null;
275
277
  /**
@@ -287,14 +289,14 @@ export interface Context {
287
289
  */
288
290
  instanceId?: string | null;
289
291
  }
290
- export declare enum IdentityType {
292
+ declare enum IdentityType {
291
293
  UNKNOWN = "UNKNOWN",
292
294
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
293
295
  MEMBER = "MEMBER",
294
296
  WIX_USER = "WIX_USER",
295
297
  APP = "APP"
296
298
  }
297
- export interface IdentificationData extends IdentificationDataIdOneOf {
299
+ interface IdentificationData extends IdentificationDataIdOneOf {
298
300
  /**
299
301
  * ID of a site visitor that has not logged in to the site.
300
302
  * @format GUID
@@ -319,7 +321,7 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
319
321
  identityType?: IdentityType;
320
322
  }
321
323
  /** @oneof */
322
- export interface IdentificationDataIdOneOf {
324
+ interface IdentificationDataIdOneOf {
323
325
  /**
324
326
  * ID of a site visitor that has not logged in to the site.
325
327
  * @format GUID
@@ -341,3 +343,85 @@ export interface IdentificationDataIdOneOf {
341
343
  */
342
344
  appId?: string;
343
345
  }
346
+
347
+ interface GetChargeLimitEnvelope {
348
+ request: GetChargeLimitRequest;
349
+ metadata: Context;
350
+ }
351
+ interface ListChargesEnvelope {
352
+ request: ListChargesRequest;
353
+ metadata: Context;
354
+ }
355
+ interface ChargesRejectedEventEnvelope {
356
+ request: ChargesRejectedRequest;
357
+ metadata: Context;
358
+ }
359
+ interface InvoiceCreatedEventEnvelope {
360
+ request: InvoiceCreatedRequest;
361
+ metadata: Context;
362
+ }
363
+ interface ChargeLimitUpdatedEventEnvelope {
364
+ request: ChargeLimitUpdatedRequest;
365
+ metadata: Context;
366
+ }
367
+ declare const provideHandlers$1: ServicePluginDefinition<{
368
+ /**
369
+ *
370
+ * Wix calls this method to retrieve the initial charge limit for a paid instance
371
+ * of your app. This happens every time a customer is upgrading to a paid version of
372
+ * your app.
373
+ *
374
+ * You can't update the charge limit after you've set an initial
375
+ * value. Customers can increase the limit in their site's dashboard, currently they
376
+ * aren't allowed to decrease it. */
377
+ getChargeLimit(payload: GetChargeLimitEnvelope): GetChargeLimitResponse | Promise<GetChargeLimitResponse>;
378
+ /**
379
+ *
380
+ * Wix calls this method to retrieve a list of charges for a paid instance
381
+ * of your app. This happens when Wix creates an invoice or in case the customer
382
+ * wants to preview how much your app would charge them at the moment.
383
+ *
384
+ * You must return the charges in the currency that's specified in the request,
385
+ * you aren't allowed to return more than 5 charges, and their sum must be lower
386
+ * than the charge limit.
387
+ *
388
+ * You may not bill customers for any usage that didn’t occur during the period
389
+ * Wix specifies when retrieving the charges. If Wix discovers that your app has
390
+ * charged customers for usage outside of an invoice's specified period, we may
391
+ * take action such as blocking your app from charging the customer, removing
392
+ * your app from the Wix App Market, revoking your access to the Wix developer
393
+ * program, or pursuing legal action to recover damages caused by overcharging.
394
+ * We understand that mistakes can happen and encourage you to contact
395
+ * [the Wix App Market team](https://devforum.wix.com/kb/en/contact) immediately if you
396
+ * become aware of any overcharging issues so that we can work together to
397
+ * resolve the situation. */
398
+ listCharges(payload: ListChargesEnvelope): ListChargesResponse | Promise<ListChargesResponse>;
399
+ /**
400
+ *
401
+ * Triggered in case Wix doesn't accept the charges you've returned in the
402
+ * List Charges method.
403
+ *
404
+ *
405
+ * You aren't allowed to charge a site owner more than the charge limit. Wix
406
+ * call List Charges in regular intervals until the sum of all charges is lower than the
407
+ * charge limit. Wix doesn't create an invoice in case the charges aren't accepted. */
408
+ chargesRejectedEvent(payload: ChargesRejectedEventEnvelope): ChargesRejectedResponse | Promise<ChargesRejectedResponse>;
409
+ /**
410
+ *
411
+ * Triggered in case Wix creates an invoice that includes charges for an instance
412
+ * of your app. */
413
+ invoiceCreatedEvent(payload: InvoiceCreatedEventEnvelope): InvoiceCreatedResponse | Promise<InvoiceCreatedResponse>;
414
+ /**
415
+ *
416
+ * Triggered in case the charge limit for an instance of your app is updated.
417
+ *
418
+ *
419
+ * You can't update the charge limit after you've set an initial
420
+ * value. Site owners can increase the limit in their site's dashboard,
421
+ * currently they aren't allowed to decrease it. */
422
+ chargeLimitUpdatedEvent(payload: ChargeLimitUpdatedEventEnvelope): ChargeLimitUpdatedResponse | Promise<ChargeLimitUpdatedResponse>;
423
+ }>;
424
+
425
+ declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1>;
426
+
427
+ export { type AlternativeUri, type ChargeLimitUpdatedRequest, type ChargeLimitUpdatedResponse, type ChargeLineItem, ChargesRejectedReason, type ChargesRejectedRequest, type ChargesRejectedResponse, type Context, type CustomChargesConfig, type GetChargeLimitRequest, type GetChargeLimitResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, Intent, type InvoiceCreatedRequest, type InvoiceCreatedResponse, type InvoiceLineItem, type ListChargesRequest, type ListChargesResponse, type SpiBaseUri, provideHandlers, provideHandlers$1 as publicProvideHandlers };
@@ -0,0 +1,122 @@
1
+ // src/service-plugins-types.ts
2
+ var Intent = /* @__PURE__ */ ((Intent2) => {
3
+ Intent2["DISPLAY_ONLY"] = "DISPLAY_ONLY";
4
+ Intent2["CREATE_INVOICE"] = "CREATE_INVOICE";
5
+ return Intent2;
6
+ })(Intent || {});
7
+ var ChargesRejectedReason = /* @__PURE__ */ ((ChargesRejectedReason2) => {
8
+ ChargesRejectedReason2["UNKNOWN"] = "UNKNOWN";
9
+ ChargesRejectedReason2["CHARGE_LIMIT_EXCEEDED"] = "CHARGE_LIMIT_EXCEEDED";
10
+ ChargesRejectedReason2["TOO_MANY_CHARGES"] = "TOO_MANY_CHARGES";
11
+ ChargesRejectedReason2["INVALID_FORMAT"] = "INVALID_FORMAT";
12
+ return ChargesRejectedReason2;
13
+ })(ChargesRejectedReason || {});
14
+ var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
15
+ IdentityType2["UNKNOWN"] = "UNKNOWN";
16
+ IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
17
+ IdentityType2["MEMBER"] = "MEMBER";
18
+ IdentityType2["WIX_USER"] = "WIX_USER";
19
+ IdentityType2["APP"] = "APP";
20
+ return IdentityType2;
21
+ })(IdentityType || {});
22
+
23
+ // src/interfaces-premium-v1-custom-charges-provider.public.ts
24
+ import { ServicePluginDefinition } from "@wix/sdk-types";
25
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
26
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
27
+ import {
28
+ renameKeysFromSDKRequestToRESTRequest,
29
+ renameKeysFromRESTResponseToSDKResponse
30
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
31
+ var provideHandlers = ServicePluginDefinition("PREMIUM_CUSTOM_CHARGES", [
32
+ {
33
+ name: "getChargeLimit",
34
+ primaryHttpMappingPath: "/v1/charge-limit",
35
+ transformations: {
36
+ toREST: (payload) => {
37
+ const toRestResponse = payload;
38
+ return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
39
+ },
40
+ fromREST: (payload) => {
41
+ const fromRestRequest = payload;
42
+ return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
43
+ }
44
+ }
45
+ },
46
+ {
47
+ name: "listCharges",
48
+ primaryHttpMappingPath: "/v1/charges",
49
+ transformations: {
50
+ toREST: (payload) => {
51
+ const toRestResponse = payload;
52
+ return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
53
+ },
54
+ fromREST: (payload) => {
55
+ const fromRestRequest = transformPaths(payload, [
56
+ {
57
+ transformFn: transformRESTTimestampToSDKTimestamp,
58
+ paths: [
59
+ { path: "request.periodStart" },
60
+ { path: "request.periodEnd" }
61
+ ]
62
+ }
63
+ ]);
64
+ return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
65
+ }
66
+ }
67
+ },
68
+ {
69
+ name: "chargesRejectedEvent",
70
+ primaryHttpMappingPath: "/v1/charges-rejected",
71
+ transformations: {
72
+ toREST: (payload) => {
73
+ const toRestResponse = payload;
74
+ return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
75
+ },
76
+ fromREST: (payload) => {
77
+ const fromRestRequest = payload;
78
+ return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
79
+ }
80
+ }
81
+ },
82
+ {
83
+ name: "invoiceCreatedEvent",
84
+ primaryHttpMappingPath: "/v1/invoice-created",
85
+ transformations: {
86
+ toREST: (payload) => {
87
+ const toRestResponse = payload;
88
+ return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
89
+ },
90
+ fromREST: (payload) => {
91
+ const fromRestRequest = payload;
92
+ return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
93
+ }
94
+ }
95
+ },
96
+ {
97
+ name: "chargeLimitUpdatedEvent",
98
+ primaryHttpMappingPath: "/v1/limit-updated",
99
+ transformations: {
100
+ toREST: (payload) => {
101
+ const toRestResponse = payload;
102
+ return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
103
+ },
104
+ fromREST: (payload) => {
105
+ const fromRestRequest = payload;
106
+ return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
107
+ }
108
+ }
109
+ }
110
+ ]);
111
+
112
+ // src/interfaces-premium-v1-custom-charges-provider.context.ts
113
+ import { createServicePluginModule } from "@wix/sdk-runtime/service-plugin-modules";
114
+ var provideHandlers2 = createServicePluginModule(provideHandlers);
115
+ export {
116
+ ChargesRejectedReason,
117
+ IdentityType,
118
+ Intent,
119
+ provideHandlers2 as provideHandlers,
120
+ provideHandlers as publicProvideHandlers
121
+ };
122
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/service-plugins-types.ts","../../../src/interfaces-premium-v1-custom-charges-provider.public.ts","../../../src/interfaces-premium-v1-custom-charges-provider.context.ts"],"sourcesContent":["export interface GetChargeLimitRequest {\n /**\n * ID of the subscription for which Wix retrieves the charge limit. Equals\n * `null` in case Wix hasn't created the subscription when retrieving an\n * initial charge limit. To track usage and billing for apps, we recommend to\n * use `instanceId` instead of the `subscriptionId`.\n * @format GUID\n */\n subscriptionId?: string | null;\n /**\n * Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.\n *\n * 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\n * format of the charge limit. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n}\n\nexport interface GetChargeLimitResponse {\n /**\n * Retrieved charge limit for the app instance. You can't update the\n * charge limit after you've set an initial value. Site owners can increase the\n * limit in their site's dashboard, currently they aren't allowed to decrease it.\n * @format DECIMAL_VALUE\n * @decimalValue options { gt:0.00 }\n */\n chargeLimit?: string | null;\n}\n\nexport interface ListChargesRequest {\n /**\n * ID of the subscription for which Wix retrieves your custom charges.\n * To track usage and billing for apps, we recommend to use `instanceId` instead\n * of the `subscriptionId`.\n * @format GUID\n */\n subscriptionId?: string;\n /**\n * Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.\n *\n * 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\n * format of your charges to return. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Begin of the period Wix retrieves the app instance's charges for in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n periodStart?: Date | null;\n /**\n * End of the period Wix retrieves the app instance's charges for in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n periodEnd?: Date | null;\n /** Information about what Wix intends to do with the retrieved charges. */\n intent?: Intent;\n}\n\nexport enum Intent {\n /** Inform the customer about how much your app would charge them at the moment. Wix doesn't create an invoice. */\n DISPLAY_ONLY = 'DISPLAY_ONLY',\n /** Create an invoice for the customer. */\n CREATE_INVOICE = 'CREATE_INVOICE',\n}\n\nexport interface ListChargesResponse {\n /**\n * Retrieved charges.\n *\n * Max: 5 charges\n * @maxSize 5\n */\n charges?: ChargeLineItem[];\n}\n\nexport interface ChargeLineItem {\n /**\n * ID of the charge. Make sure to save the charge ID on your servers for future\n * reference. Identical to `lineItem.chargeId` in the Invoice Created Event.\n *\n * Max: 64 characters\n * @maxLength 64\n */\n _id?: string | null;\n /** Charge description. */\n description?: string;\n /**\n * Charge amount in the currency that's specified in the request. Use a whole number\n * or separate major and minor units with a dot. For example, `10` or `1.99`. If\n * you return an amount with more minor units than supported according to\n * [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes),\n * Wix truncates the additional minor units.\n *\n * Min: `0.50`\n * @format DECIMAL_VALUE\n */\n amount?: string;\n}\n\nexport interface ChargesRejectedRequest {\n /**\n * ID of the subscription for which Wix hasn't accepted your custom charges.\n * To track usage and billing for apps, we recommend to use `instanceId` instead\n * of the `subscriptionId`.\n * @format GUID\n */\n subscriptionId?: string;\n /**\n * Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.\n *\n * 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\n * format of the charges. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * IDs of the rejected charges.\n *\n * Max: 5 charges\n * @maxSize 5\n */\n chargeIds?: string[] | null;\n /**\n * Maximum amount that your app may charge the customer per billing cycle.\n *\n * Min: `0.50`\n * @format DECIMAL_VALUE\n * @decimalValue options { gt:0.00 }\n */\n chargeLimit?: string | null;\n /**\n * Information about why Wix has rejected your app's charges.\n *\n * Max: 20 reasons\n * @maxSize 20\n */\n reasons?: ChargesRejectedReason[];\n}\n\nexport enum ChargesRejectedReason {\n /** There is no information about why Wix has rejected the charges. */\n UNKNOWN = 'UNKNOWN',\n /** The sum of the charges is higher than the limit that you may charge the customer per billing cycle. */\n CHARGE_LIMIT_EXCEEDED = 'CHARGE_LIMIT_EXCEEDED',\n /** You can't provide more than 5 charges per invoice. */\n TOO_MANY_CHARGES = 'TOO_MANY_CHARGES',\n /** You must submit charges as whole numbers or use a dot to separate major and minor units. For example, `10` or `1.50`. Currently, Wix doesn't validate whether the submitted number of decimals for the minor unit is supported for the given currency. */\n INVALID_FORMAT = 'INVALID_FORMAT',\n}\n\nexport interface ChargesRejectedResponse {}\n\nexport interface InvoiceCreatedRequest {\n /**\n * ID of the subscription for which Wix has created an invoice that includes\n * your custom charges. To track usage and billing for apps, we recommend to use\n * `instanceId` instead of the `subscriptionId`.\n * @format GUID\n */\n subscriptionId?: string;\n /**\n * Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.\n *\n * 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\n * format of the charges. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n /** ID of the created invoice. */\n invoiceId?: string;\n /**\n * Line items included in the invoice.\n * @maxSize 5\n */\n lineItems?: InvoiceLineItem[];\n}\n\nexport interface InvoiceLineItem {\n /**\n * ID of the charge as returned in List Charges.\n *\n * Max: 64 characters\n * @maxLength 64\n */\n chargeId?: string | null;\n /**\n * Charge amount.\n * @format DECIMAL_VALUE\n */\n amount?: string;\n /**\n * ID of the line item in the invoice that Wix sends to the customer.\n * @format GUID\n */\n _id?: string;\n}\n\nexport interface InvoiceCreatedResponse {}\n\nexport interface ChargeLimitUpdatedRequest {\n /**\n * ID of the subscription for which the charge limit has been updated.\n * To track usage and billing for apps, we recommend to use `instanceId` instead\n * of the `subscriptionId`.\n * @format GUID\n */\n subscriptionId?: string;\n /**\n * Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.\n *\n * 3-letter currency code in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\n * format of the charges. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Updated charge limit.\n * @format DECIMAL_VALUE\n */\n chargeLimit?: string | null;\n}\n\nexport interface ChargeLimitUpdatedResponse {}\n\nexport interface CustomChargesConfig {\n /**\n * Base part of your integration's deployment URI for the Custom Charges SPI.\n * For example `\"https://provider.example.com\"`, if Wix should call your\n * integration at `https://provider.example.com/v1/charge-limit` for the\n * Get Charge Limit method.\n */\n baseUri?: SpiBaseUri;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\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?: IdentityType;\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n GetChargeLimitRequest,\n GetChargeLimitResponse,\n ListChargesRequest,\n ListChargesResponse,\n ChargesRejectedRequest,\n ChargesRejectedResponse,\n InvoiceCreatedRequest,\n InvoiceCreatedResponse,\n ChargeLimitUpdatedRequest,\n ChargeLimitUpdatedResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface GetChargeLimitEnvelope {\n request: GetChargeLimitRequest;\n metadata: Context;\n}\n\nexport interface ListChargesEnvelope {\n request: ListChargesRequest;\n metadata: Context;\n}\n\nexport interface ChargesRejectedEventEnvelope {\n request: ChargesRejectedRequest;\n metadata: Context;\n}\n\nexport interface InvoiceCreatedEventEnvelope {\n request: InvoiceCreatedRequest;\n metadata: Context;\n}\n\nexport interface ChargeLimitUpdatedEventEnvelope {\n request: ChargeLimitUpdatedRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Wix calls this method to retrieve the initial charge limit for a paid instance\n * of your app. This happens every time a customer is upgrading to a paid version of\n * your app.\n *\n * You can't update the charge limit after you've set an initial\n * value. Customers can increase the limit in their site's dashboard, currently they\n * aren't allowed to decrease it. */\n getChargeLimit(\n payload: GetChargeLimitEnvelope\n ): GetChargeLimitResponse | Promise<GetChargeLimitResponse>;\n\n /**\n *\n * Wix calls this method to retrieve a list of charges for a paid instance\n * of your app. This happens when Wix creates an invoice or in case the customer\n * wants to preview how much your app would charge them at the moment.\n *\n * You must return the charges in the currency that's specified in the request,\n * you aren't allowed to return more than 5 charges, and their sum must be lower\n * than the charge limit.\n *\n * You may not bill customers for any usage that didn’t occur during the period\n * Wix specifies when retrieving the charges. If Wix discovers that your app has\n * charged customers for usage outside of an invoice's specified period, we may\n * take action such as blocking your app from charging the customer, removing\n * your app from the Wix App Market, revoking your access to the Wix developer\n * program, or pursuing legal action to recover damages caused by overcharging.\n * We understand that mistakes can happen and encourage you to contact\n * [the Wix App Market team](https://devforum.wix.com/kb/en/contact) immediately if you\n * become aware of any overcharging issues so that we can work together to\n * resolve the situation. */\n listCharges(\n payload: ListChargesEnvelope\n ): ListChargesResponse | Promise<ListChargesResponse>;\n\n /**\n *\n * Triggered in case Wix doesn't accept the charges you've returned in the\n * List Charges method.\n *\n *\n * You aren't allowed to charge a site owner more than the charge limit. Wix\n * call List Charges in regular intervals until the sum of all charges is lower than the\n * charge limit. Wix doesn't create an invoice in case the charges aren't accepted. */\n chargesRejectedEvent(\n payload: ChargesRejectedEventEnvelope\n ): ChargesRejectedResponse | Promise<ChargesRejectedResponse>;\n\n /**\n *\n * Triggered in case Wix creates an invoice that includes charges for an instance\n * of your app. */\n invoiceCreatedEvent(\n payload: InvoiceCreatedEventEnvelope\n ): InvoiceCreatedResponse | Promise<InvoiceCreatedResponse>;\n\n /**\n *\n * Triggered in case the charge limit for an instance of your app is updated.\n *\n *\n * You can't update the charge limit after you've set an initial\n * value. Site owners can increase the limit in their site's dashboard,\n * currently they aren't allowed to decrease it. */\n chargeLimitUpdatedEvent(\n payload: ChargeLimitUpdatedEventEnvelope\n ): ChargeLimitUpdatedResponse | Promise<ChargeLimitUpdatedResponse>;\n}>('PREMIUM_CUSTOM_CHARGES', [\n {\n name: 'getChargeLimit',\n primaryHttpMappingPath: '/v1/charge-limit',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'listCharges',\n primaryHttpMappingPath: '/v1/charges',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.periodStart' },\n { path: 'request.periodEnd' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'chargesRejectedEvent',\n primaryHttpMappingPath: '/v1/charges-rejected',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'invoiceCreatedEvent',\n primaryHttpMappingPath: '/v1/invoice-created',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'chargeLimitUpdatedEvent',\n primaryHttpMappingPath: '/v1/limit-updated',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-premium-v1-custom-charges-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-premium-v1-custom-charges-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> = createServicePluginModule(publicProvideHandlers);\n"],"mappings":";AA8DO,IAAK,SAAL,kBAAKA,YAAL;AAEL,EAAAA,QAAA,kBAAe;AAEf,EAAAA,QAAA,oBAAiB;AAJP,SAAAA;AAAA,GAAA;AAkFL,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,aAAU;AAEV,EAAAA,uBAAA,2BAAwB;AAExB,EAAAA,uBAAA,sBAAmB;AAEnB,EAAAA,uBAAA,oBAAiB;AARP,SAAAA;AAAA,GAAA;AAgKL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;AChTZ,SAAS,+BAA+B;AAcxC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AA2BA,IAAM,kBAAkB,wBAsE5B,0BAA0B;AAAA,EAC3B;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB,eAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sBAAsB;AAAA,cAC9B,EAAE,MAAM,oBAAoB;AAAA,YAC9B;AAAA,UACF;AAAA,QACF,CAAC;AAED,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AChND,SAAS,iCAAiC;AAMnC,IAAMC,mBAET,0BAA0B,eAAqB;","names":["Intent","ChargesRejectedReason","IdentityType","provideHandlers"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_app-management_custom-charges",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -8,18 +8,18 @@
8
8
  "keywords": [],
9
9
  "sideEffects": false,
10
10
  "main": "./build/cjs/index.js",
11
- "types": "./build/es/index.d.ts",
11
+ "types": "./build/cjs/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./build/es/index.js",
14
+ "import": "./build/es/index.mjs",
15
15
  "require": "./build/cjs/index.js",
16
- "types": "./build/es/index.d.ts"
16
+ "types": "./build/es/index.d.mts"
17
17
  },
18
18
  "./package.json": "./package.json",
19
19
  "./meta": {
20
- "import": "./build/es/meta.js",
20
+ "import": "./build/es/meta.mjs",
21
21
  "require": "./build/cjs/meta.js",
22
- "types": "./build/es/meta.d.ts"
22
+ "types": "./build/es/meta.d.mts"
23
23
  }
24
24
  },
25
25
  "files": [
@@ -32,10 +32,11 @@
32
32
  "@wix/sdk-types": "^1.13.28"
33
33
  },
34
34
  "devDependencies": {
35
+ "tsup": "^8.4.0",
35
36
  "typescript": "^5.3.2"
36
37
  },
37
38
  "scripts": {
38
- "build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.internal.json tsconfig.internal.esm.json",
39
+ "build": "tsup",
39
40
  "test": ":"
40
41
  },
41
42
  "wix": {
@@ -48,5 +49,5 @@
48
49
  "fqdn": "wix.interfaces.premium.v1.custom_charges_provider"
49
50
  }
50
51
  },
51
- "falconPackageHash": "afdbfd68403817e929375ddbf788744931c85c433be0e05b7aca690e"
52
+ "falconPackageHash": "b8b57d4e0d9c0f1944ae9560259790b051962b5e0f339f833c32b913"
52
53
  }
@@ -1,59 +0,0 @@
1
- import { GetChargeLimitResponse, ListChargesResponse, ChargesRejectedResponse, InvoiceCreatedResponse, ChargeLimitUpdatedResponse } from './src/service-plugins-types.js';
2
- import { GetChargeLimitEnvelope, ListChargesEnvelope, ChargesRejectedEventEnvelope, InvoiceCreatedEventEnvelope, ChargeLimitUpdatedEventEnvelope } from './src/interfaces-premium-v1-custom-charges-provider.public.js';
3
- export * from './src/service-plugins-types';
4
- export { GetChargeLimitEnvelope, ListChargesEnvelope, ChargesRejectedEventEnvelope, InvoiceCreatedEventEnvelope, ChargeLimitUpdatedEventEnvelope, };
5
- /**
6
- * Wix calls this method to retrieve the initial charge limit for a paid instance
7
- * of your app. This happens every time a customer is upgrading to a paid version of
8
- * your app.
9
- *
10
- * You can't update the charge limit after you've set an initial
11
- * value. Customers can increase the limit in their site's dashboard, currently they
12
- * aren't allowed to decrease it.
13
- */
14
- export declare function getChargeLimit(payload: GetChargeLimitEnvelope): GetChargeLimitResponse | Promise<GetChargeLimitResponse>;
15
- /**
16
- * Wix calls this method to retrieve a list of charges for a paid instance
17
- * of your app. This happens when Wix creates an invoice or in case the customer
18
- * wants to preview how much your app would charge them at the moment.
19
- *
20
- * You must return the charges in the currency that's specified in the request,
21
- * you aren't allowed to return more than 5 charges, and their sum must be lower
22
- * than the charge limit.
23
- *
24
- * You may not bill customers for any usage that didn’t occur during the period
25
- * Wix specifies when retrieving the charges. If Wix discovers that your app has
26
- * charged customers for usage outside of an invoice's specified period, we may
27
- * take action such as blocking your app from charging the customer, removing
28
- * your app from the Wix App Market, revoking your access to the Wix developer
29
- * program, or pursuing legal action to recover damages caused by overcharging.
30
- * We understand that mistakes can happen and encourage you to contact
31
- * [the Wix App Market team](https://devforum.wix.com/kb/en/contact) immediately if you
32
- * become aware of any overcharging issues so that we can work together to
33
- * resolve the situation.
34
- */
35
- export declare function listCharges(payload: ListChargesEnvelope): ListChargesResponse | Promise<ListChargesResponse>;
36
- /**
37
- * Triggered in case Wix doesn't accept the charges you've returned in the
38
- * List Charges method.
39
- *
40
- *
41
- * You aren't allowed to charge a site owner more than the charge limit. Wix
42
- * call List Charges in regular intervals until the sum of all charges is lower than the
43
- * charge limit. Wix doesn't create an invoice in case the charges aren't accepted.
44
- */
45
- export declare function chargesRejectedEvent(payload: ChargesRejectedEventEnvelope): ChargesRejectedResponse | Promise<ChargesRejectedResponse>;
46
- /**
47
- * Triggered in case Wix creates an invoice that includes charges for an instance
48
- * of your app.
49
- */
50
- export declare function invoiceCreatedEvent(payload: InvoiceCreatedEventEnvelope): InvoiceCreatedResponse | Promise<InvoiceCreatedResponse>;
51
- /**
52
- * Triggered in case the charge limit for an instance of your app is updated.
53
- *
54
- *
55
- * You can't update the charge limit after you've set an initial
56
- * value. Site owners can increase the limit in their site's dashboard,
57
- * currently they aren't allowed to decrease it.
58
- */
59
- export declare function chargeLimitUpdatedEvent(payload: ChargeLimitUpdatedEventEnvelope): ChargeLimitUpdatedResponse | Promise<ChargeLimitUpdatedResponse>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __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);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/service-plugins-types"), exports);
18
- //# sourceMappingURL=index.typings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA,8DAA4C"}
@@ -1,5 +0,0 @@
1
- import './interfaces-premium-v1-custom-charges-provider.public.js';
2
- import { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';
3
- import { provideHandlers as publicProvideHandlers } from './interfaces-premium-v1-custom-charges-provider.public.js';
4
- export { publicProvideHandlers };
5
- export declare const provideHandlers: ReturnType<typeof createServicePluginModule<typeof publicProvideHandlers>>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.provideHandlers = exports.publicProvideHandlers = void 0;
4
- require("./interfaces-premium-v1-custom-charges-provider.public.js");
5
- const service_plugin_modules_1 = require("@wix/sdk-runtime/service-plugin-modules");
6
- const interfaces_premium_v1_custom_charges_provider_public_js_1 = require("./interfaces-premium-v1-custom-charges-provider.public.js");
7
- Object.defineProperty(exports, "publicProvideHandlers", { enumerable: true, get: function () { return interfaces_premium_v1_custom_charges_provider_public_js_1.provideHandlers; } });
8
- exports.provideHandlers = (0, service_plugin_modules_1.createServicePluginModule)(interfaces_premium_v1_custom_charges_provider_public_js_1.provideHandlers);
9
- //# sourceMappingURL=interfaces-premium-v1-custom-charges-provider.context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces-premium-v1-custom-charges-provider.context.js","sourceRoot":"","sources":["../../../src/interfaces-premium-v1-custom-charges-provider.context.ts"],"names":[],"mappings":";;;AAAA,qEAAmE;AACnE,oFAAoF;AACpF,uIAAqH;AAE5G,sGAFmB,yEAAqB,OAEnB;AAEjB,QAAA,eAAe,GAExB,IAAA,kDAAyB,EAAC,yEAAqB,CAAC,CAAC"}
@@ -1,79 +0,0 @@
1
- import { ServicePluginDefinition } from '@wix/sdk-types';
2
- import { Context, GetChargeLimitRequest, GetChargeLimitResponse, ListChargesRequest, ListChargesResponse, ChargesRejectedRequest, ChargesRejectedResponse, InvoiceCreatedRequest, InvoiceCreatedResponse, ChargeLimitUpdatedRequest, ChargeLimitUpdatedResponse } from './service-plugins-types.js';
3
- export interface GetChargeLimitEnvelope {
4
- request: GetChargeLimitRequest;
5
- metadata: Context;
6
- }
7
- export interface ListChargesEnvelope {
8
- request: ListChargesRequest;
9
- metadata: Context;
10
- }
11
- export interface ChargesRejectedEventEnvelope {
12
- request: ChargesRejectedRequest;
13
- metadata: Context;
14
- }
15
- export interface InvoiceCreatedEventEnvelope {
16
- request: InvoiceCreatedRequest;
17
- metadata: Context;
18
- }
19
- export interface ChargeLimitUpdatedEventEnvelope {
20
- request: ChargeLimitUpdatedRequest;
21
- metadata: Context;
22
- }
23
- export declare const provideHandlers: ServicePluginDefinition<{
24
- /**
25
- *
26
- * Wix calls this method to retrieve the initial charge limit for a paid instance
27
- * of your app. This happens every time a customer is upgrading to a paid version of
28
- * your app.
29
- *
30
- * You can't update the charge limit after you've set an initial
31
- * value. Customers can increase the limit in their site's dashboard, currently they
32
- * aren't allowed to decrease it. */
33
- getChargeLimit(payload: GetChargeLimitEnvelope): GetChargeLimitResponse | Promise<GetChargeLimitResponse>;
34
- /**
35
- *
36
- * Wix calls this method to retrieve a list of charges for a paid instance
37
- * of your app. This happens when Wix creates an invoice or in case the customer
38
- * wants to preview how much your app would charge them at the moment.
39
- *
40
- * You must return the charges in the currency that's specified in the request,
41
- * you aren't allowed to return more than 5 charges, and their sum must be lower
42
- * than the charge limit.
43
- *
44
- * You may not bill customers for any usage that didn’t occur during the period
45
- * Wix specifies when retrieving the charges. If Wix discovers that your app has
46
- * charged customers for usage outside of an invoice's specified period, we may
47
- * take action such as blocking your app from charging the customer, removing
48
- * your app from the Wix App Market, revoking your access to the Wix developer
49
- * program, or pursuing legal action to recover damages caused by overcharging.
50
- * We understand that mistakes can happen and encourage you to contact
51
- * [the Wix App Market team](https://devforum.wix.com/kb/en/contact) immediately if you
52
- * become aware of any overcharging issues so that we can work together to
53
- * resolve the situation. */
54
- listCharges(payload: ListChargesEnvelope): ListChargesResponse | Promise<ListChargesResponse>;
55
- /**
56
- *
57
- * Triggered in case Wix doesn't accept the charges you've returned in the
58
- * List Charges method.
59
- *
60
- *
61
- * You aren't allowed to charge a site owner more than the charge limit. Wix
62
- * call List Charges in regular intervals until the sum of all charges is lower than the
63
- * charge limit. Wix doesn't create an invoice in case the charges aren't accepted. */
64
- chargesRejectedEvent(payload: ChargesRejectedEventEnvelope): ChargesRejectedResponse | Promise<ChargesRejectedResponse>;
65
- /**
66
- *
67
- * Triggered in case Wix creates an invoice that includes charges for an instance
68
- * of your app. */
69
- invoiceCreatedEvent(payload: InvoiceCreatedEventEnvelope): InvoiceCreatedResponse | Promise<InvoiceCreatedResponse>;
70
- /**
71
- *
72
- * Triggered in case the charge limit for an instance of your app is updated.
73
- *
74
- *
75
- * You can't update the charge limit after you've set an initial
76
- * value. Site owners can increase the limit in their site's dashboard,
77
- * currently they aren't allowed to decrease it. */
78
- chargeLimitUpdatedEvent(payload: ChargeLimitUpdatedEventEnvelope): ChargeLimitUpdatedResponse | Promise<ChargeLimitUpdatedResponse>;
79
- }>;