@wix/auto_sdk_app-management_custom-charges 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/build/{cjs/src/service-plugins-types.d.ts → index.d.mts} +106 -21
  2. package/build/{internal/cjs/src/service-plugins-types.d.ts → index.d.ts} +106 -21
  3. package/build/index.js +150 -0
  4. package/build/index.js.map +1 -0
  5. package/build/index.mjs +122 -0
  6. package/build/index.mjs.map +1 -0
  7. package/build/{es/src/service-plugins-types.d.ts → internal/index.d.mts} +106 -21
  8. package/build/internal/{es/src/service-plugins-types.d.ts → index.d.ts} +106 -21
  9. package/build/internal/index.js +150 -0
  10. package/build/internal/index.js.map +1 -0
  11. package/build/internal/index.mjs +122 -0
  12. package/build/internal/index.mjs.map +1 -0
  13. package/package.json +13 -12
  14. package/build/cjs/index.d.ts +0 -2
  15. package/build/cjs/index.js +0 -19
  16. package/build/cjs/index.js.map +0 -1
  17. package/build/cjs/index.typings.d.ts +0 -59
  18. package/build/cjs/index.typings.js +0 -18
  19. package/build/cjs/index.typings.js.map +0 -1
  20. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
  21. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -9
  22. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
  23. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
  24. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -88
  25. package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
  26. package/build/cjs/src/service-plugins-types.js +0 -30
  27. package/build/cjs/src/service-plugins-types.js.map +0 -1
  28. package/build/es/index.d.ts +0 -2
  29. package/build/es/index.js +0 -3
  30. package/build/es/index.js.map +0 -1
  31. package/build/es/index.typings.d.ts +0 -59
  32. package/build/es/index.typings.js +0 -2
  33. package/build/es/index.typings.js.map +0 -1
  34. package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
  35. package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -6
  36. package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
  37. package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
  38. package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -85
  39. package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
  40. package/build/es/src/service-plugins-types.js +0 -27
  41. package/build/es/src/service-plugins-types.js.map +0 -1
  42. package/build/internal/cjs/index.d.ts +0 -2
  43. package/build/internal/cjs/index.js +0 -19
  44. package/build/internal/cjs/index.js.map +0 -1
  45. package/build/internal/cjs/index.typings.d.ts +0 -59
  46. package/build/internal/cjs/index.typings.js +0 -18
  47. package/build/internal/cjs/index.typings.js.map +0 -1
  48. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
  49. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -9
  50. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
  51. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
  52. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -88
  53. package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
  54. package/build/internal/cjs/src/service-plugins-types.js +0 -30
  55. package/build/internal/cjs/src/service-plugins-types.js.map +0 -1
  56. package/build/internal/es/index.d.ts +0 -2
  57. package/build/internal/es/index.js +0 -3
  58. package/build/internal/es/index.js.map +0 -1
  59. package/build/internal/es/index.typings.d.ts +0 -59
  60. package/build/internal/es/index.typings.js +0 -2
  61. package/build/internal/es/index.typings.js.map +0 -1
  62. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
  63. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -6
  64. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
  65. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
  66. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -85
  67. package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
  68. package/build/internal/es/src/service-plugins-types.js +0 -27
  69. package/build/internal/es/src/service-plugins-types.js.map +0 -1
@@ -1,85 +0,0 @@
1
- import { ServicePluginDefinition } from '@wix/sdk-types';
2
- import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
3
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
4
- import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
5
- export const provideHandlers = ServicePluginDefinition('PREMIUM_CUSTOM_CHARGES', [
6
- {
7
- name: 'getChargeLimit',
8
- primaryHttpMappingPath: '/v1/charge-limit',
9
- transformations: {
10
- toREST: (payload) => {
11
- const toRestResponse = payload;
12
- return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
13
- },
14
- fromREST: (payload) => {
15
- const fromRestRequest = payload;
16
- return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
17
- },
18
- },
19
- },
20
- {
21
- name: 'listCharges',
22
- primaryHttpMappingPath: '/v1/charges',
23
- transformations: {
24
- toREST: (payload) => {
25
- const toRestResponse = payload;
26
- return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
27
- },
28
- fromREST: (payload) => {
29
- const fromRestRequest = transformPaths(payload, [
30
- {
31
- transformFn: transformRESTTimestampToSDKTimestamp,
32
- paths: [
33
- { path: 'request.periodStart' },
34
- { path: 'request.periodEnd' },
35
- ],
36
- },
37
- ]);
38
- return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
39
- },
40
- },
41
- },
42
- {
43
- name: 'chargesRejectedEvent',
44
- primaryHttpMappingPath: '/v1/charges-rejected',
45
- transformations: {
46
- toREST: (payload) => {
47
- const toRestResponse = payload;
48
- return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
49
- },
50
- fromREST: (payload) => {
51
- const fromRestRequest = payload;
52
- return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
53
- },
54
- },
55
- },
56
- {
57
- name: 'invoiceCreatedEvent',
58
- primaryHttpMappingPath: '/v1/invoice-created',
59
- transformations: {
60
- toREST: (payload) => {
61
- const toRestResponse = payload;
62
- return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
63
- },
64
- fromREST: (payload) => {
65
- const fromRestRequest = payload;
66
- return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
67
- },
68
- },
69
- },
70
- {
71
- name: 'chargeLimitUpdatedEvent',
72
- primaryHttpMappingPath: '/v1/limit-updated',
73
- transformations: {
74
- toREST: (payload) => {
75
- const toRestResponse = payload;
76
- return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
77
- },
78
- fromREST: (payload) => {
79
- const fromRestRequest = payload;
80
- return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
81
- },
82
- },
83
- },
84
- ]);
85
- //# sourceMappingURL=interfaces-premium-v1-custom-charges-provider.public.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces-premium-v1-custom-charges-provider.public.js","sourceRoot":"","sources":["../../../src/interfaces-premium-v1-custom-charges-provider.public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAczD,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AA2BjD,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAuB,CAsEnD,wBAAwB,EAAE;IAC3B;QAC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AAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,qBAAqB;QAC3B,sBAAsB,EAAE,qBAAqB;QAC7C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,qCAAqC,CAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,uCAAuC,CAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,yBAAyB;QAC/B,sBAAsB,EAAE,mBAAmB;QAC3C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,qCAAqC,CAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,uCAAuC,CAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
@@ -1,27 +0,0 @@
1
- export var Intent;
2
- (function (Intent) {
3
- /** Inform the customer about how much your app would charge them at the moment. Wix doesn't create an invoice. */
4
- Intent["DISPLAY_ONLY"] = "DISPLAY_ONLY";
5
- /** Create an invoice for the customer. */
6
- Intent["CREATE_INVOICE"] = "CREATE_INVOICE";
7
- })(Intent || (Intent = {}));
8
- export var ChargesRejectedReason;
9
- (function (ChargesRejectedReason) {
10
- /** There is no information about why Wix has rejected the charges. */
11
- ChargesRejectedReason["UNKNOWN"] = "UNKNOWN";
12
- /** The sum of the charges is higher than the limit that you may charge the customer per billing cycle. */
13
- ChargesRejectedReason["CHARGE_LIMIT_EXCEEDED"] = "CHARGE_LIMIT_EXCEEDED";
14
- /** You can't provide more than 5 charges per invoice. */
15
- ChargesRejectedReason["TOO_MANY_CHARGES"] = "TOO_MANY_CHARGES";
16
- /** 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. */
17
- ChargesRejectedReason["INVALID_FORMAT"] = "INVALID_FORMAT";
18
- })(ChargesRejectedReason || (ChargesRejectedReason = {}));
19
- export var IdentityType;
20
- (function (IdentityType) {
21
- IdentityType["UNKNOWN"] = "UNKNOWN";
22
- IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
23
- IdentityType["MEMBER"] = "MEMBER";
24
- IdentityType["WIX_USER"] = "WIX_USER";
25
- IdentityType["APP"] = "APP";
26
- })(IdentityType || (IdentityType = {}));
27
- //# sourceMappingURL=service-plugins-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-plugins-types.js","sourceRoot":"","sources":["../../../src/service-plugins-types.ts"],"names":[],"mappings":"AA8DA,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,kHAAkH;IAClH,uCAA6B,CAAA;IAC7B,0CAA0C;IAC1C,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AA6ED,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,sEAAsE;IACtE,4CAAmB,CAAA;IACnB,0GAA0G;IAC1G,wEAA+C,CAAA;IAC/C,yDAAyD;IACzD,8DAAqC,CAAA;IACrC,6PAA6P;IAC7P,0DAAiC,CAAA;AACnC,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AAuJD,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uDAAuC,CAAA;IACvC,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;AACb,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB"}
@@ -1,2 +0,0 @@
1
- export * from './src/service-plugins-types';
2
- export * from './src/interfaces-premium-v1-custom-charges-provider.context';
@@ -1,19 +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
- __exportStar(require("./src/interfaces-premium-v1-custom-charges-provider.context"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,8FAA4E"}
@@ -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
- }>;
@@ -1,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.provideHandlers = void 0;
4
- const sdk_types_1 = require("@wix/sdk-types");
5
- const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
6
- const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
7
- const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
8
- exports.provideHandlers = (0, sdk_types_1.ServicePluginDefinition)('PREMIUM_CUSTOM_CHARGES', [
9
- {
10
- name: 'getChargeLimit',
11
- primaryHttpMappingPath: '/v1/charge-limit',
12
- transformations: {
13
- toREST: (payload) => {
14
- const toRestResponse = payload;
15
- return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
16
- },
17
- fromREST: (payload) => {
18
- const fromRestRequest = payload;
19
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
20
- },
21
- },
22
- },
23
- {
24
- name: 'listCharges',
25
- primaryHttpMappingPath: '/v1/charges',
26
- transformations: {
27
- toREST: (payload) => {
28
- const toRestResponse = payload;
29
- return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
30
- },
31
- fromREST: (payload) => {
32
- const fromRestRequest = (0, transform_paths_1.transformPaths)(payload, [
33
- {
34
- transformFn: timestamp_1.transformRESTTimestampToSDKTimestamp,
35
- paths: [
36
- { path: 'request.periodStart' },
37
- { path: 'request.periodEnd' },
38
- ],
39
- },
40
- ]);
41
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
42
- },
43
- },
44
- },
45
- {
46
- name: 'chargesRejectedEvent',
47
- primaryHttpMappingPath: '/v1/charges-rejected',
48
- transformations: {
49
- toREST: (payload) => {
50
- const toRestResponse = payload;
51
- return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
52
- },
53
- fromREST: (payload) => {
54
- const fromRestRequest = payload;
55
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
56
- },
57
- },
58
- },
59
- {
60
- name: 'invoiceCreatedEvent',
61
- primaryHttpMappingPath: '/v1/invoice-created',
62
- transformations: {
63
- toREST: (payload) => {
64
- const toRestResponse = payload;
65
- return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
66
- },
67
- fromREST: (payload) => {
68
- const fromRestRequest = payload;
69
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
70
- },
71
- },
72
- },
73
- {
74
- name: 'chargeLimitUpdatedEvent',
75
- primaryHttpMappingPath: '/v1/limit-updated',
76
- transformations: {
77
- toREST: (payload) => {
78
- const toRestResponse = payload;
79
- return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
80
- },
81
- fromREST: (payload) => {
82
- const fromRestRequest = payload;
83
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
84
- },
85
- },
86
- },
87
- ]);
88
- //# sourceMappingURL=interfaces-premium-v1-custom-charges-provider.public.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces-premium-v1-custom-charges-provider.public.js","sourceRoot":"","sources":["../../../../src/interfaces-premium-v1-custom-charges-provider.public.ts"],"names":[],"mappings":";;;AAAA,8CAAyD;AAczD,0EAAkG;AAClG,sFAAkF;AAClF,oFAGiD;AA2BpC,QAAA,eAAe,GAAG,IAAA,mCAAuB,EAsEnD,wBAAwB,EAAE;IAC3B;QACE,IAAI,EAAE,gBAAgB;QACtB,sBAAsB,EAAE,kBAAkB;QAC1C,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;SACF;KACF;IAED;QACE,IAAI,EAAE,qBAAqB;QAC3B,sBAAsB,EAAE,qBAAqB;QAC7C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,IAAA,8DAAqC,EAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,yBAAyB;QAC/B,sBAAsB,EAAE,mBAAmB;QAC3C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,IAAA,8DAAqC,EAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IdentityType = exports.ChargesRejectedReason = exports.Intent = void 0;
4
- var Intent;
5
- (function (Intent) {
6
- /** Inform the customer about how much your app would charge them at the moment. Wix doesn't create an invoice. */
7
- Intent["DISPLAY_ONLY"] = "DISPLAY_ONLY";
8
- /** Create an invoice for the customer. */
9
- Intent["CREATE_INVOICE"] = "CREATE_INVOICE";
10
- })(Intent || (exports.Intent = Intent = {}));
11
- var ChargesRejectedReason;
12
- (function (ChargesRejectedReason) {
13
- /** There is no information about why Wix has rejected the charges. */
14
- ChargesRejectedReason["UNKNOWN"] = "UNKNOWN";
15
- /** The sum of the charges is higher than the limit that you may charge the customer per billing cycle. */
16
- ChargesRejectedReason["CHARGE_LIMIT_EXCEEDED"] = "CHARGE_LIMIT_EXCEEDED";
17
- /** You can't provide more than 5 charges per invoice. */
18
- ChargesRejectedReason["TOO_MANY_CHARGES"] = "TOO_MANY_CHARGES";
19
- /** 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. */
20
- ChargesRejectedReason["INVALID_FORMAT"] = "INVALID_FORMAT";
21
- })(ChargesRejectedReason || (exports.ChargesRejectedReason = ChargesRejectedReason = {}));
22
- var IdentityType;
23
- (function (IdentityType) {
24
- IdentityType["UNKNOWN"] = "UNKNOWN";
25
- IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
26
- IdentityType["MEMBER"] = "MEMBER";
27
- IdentityType["WIX_USER"] = "WIX_USER";
28
- IdentityType["APP"] = "APP";
29
- })(IdentityType || (exports.IdentityType = IdentityType = {}));
30
- //# sourceMappingURL=service-plugins-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-plugins-types.js","sourceRoot":"","sources":["../../../../src/service-plugins-types.ts"],"names":[],"mappings":";;;AA8DA,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,kHAAkH;IAClH,uCAA6B,CAAA;IAC7B,0CAA0C;IAC1C,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,sBAAN,MAAM,QAKjB;AA6ED,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,sEAAsE;IACtE,4CAAmB,CAAA;IACnB,0GAA0G;IAC1G,wEAA+C,CAAA;IAC/C,yDAAyD;IACzD,8DAAqC,CAAA;IACrC,6PAA6P;IAC7P,0DAAiC,CAAA;AACnC,CAAC,EATW,qBAAqB,qCAArB,qBAAqB,QAShC;AAuJD,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uDAAuC,CAAA;IACvC,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;AACb,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB"}
@@ -1,2 +0,0 @@
1
- export * from './src/service-plugins-types';
2
- export * from './src/interfaces-premium-v1-custom-charges-provider.context';
@@ -1,3 +0,0 @@
1
- export * from './src/service-plugins-types';
2
- export * from './src/interfaces-premium-v1-custom-charges-provider.context';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6DAA6D,CAAC"}
@@ -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,2 +0,0 @@
1
- export * from './src/service-plugins-types';
2
- //# sourceMappingURL=index.typings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":"AAeA,cAAc,6BAA6B,CAAC"}
@@ -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,6 +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 const provideHandlers = createServicePluginModule(publicProvideHandlers);
6
- //# 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,OAAO,2DAA2D,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAErH,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,MAAM,CAAC,MAAM,eAAe,GAExB,yBAAyB,CAAC,qBAAqB,CAAC,CAAC"}