@wix/auto_sdk_app-management_custom-charges 1.0.34 → 1.0.35

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 (29) hide show
  1. package/build/cjs/index.d.ts +2 -2
  2. package/build/cjs/index.js +16 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +2 -2
  5. package/build/cjs/index.typings.js +16 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/{interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.d.ts → interfaces-premium-v1-custom-charges-provider.public-Dr4u8ZuA.d.ts} +34 -1
  8. package/build/es/index.d.mts +2 -2
  9. package/build/es/index.mjs +14 -0
  10. package/build/es/index.mjs.map +1 -1
  11. package/build/es/index.typings.d.mts +2 -2
  12. package/build/es/index.typings.mjs +14 -0
  13. package/build/es/index.typings.mjs.map +1 -1
  14. package/build/es/{interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.d.mts → interfaces-premium-v1-custom-charges-provider.public-Dr4u8ZuA.d.mts} +34 -1
  15. package/build/internal/cjs/index.d.ts +2 -2
  16. package/build/internal/cjs/index.js +16 -0
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/index.typings.d.ts +2 -2
  19. package/build/internal/cjs/index.typings.js +16 -0
  20. package/build/internal/cjs/index.typings.js.map +1 -1
  21. package/build/internal/cjs/{interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.d.ts → interfaces-premium-v1-custom-charges-provider.public-B8bgSqU_.d.ts} +52 -1
  22. package/build/internal/es/index.d.mts +2 -2
  23. package/build/internal/es/index.mjs +14 -0
  24. package/build/internal/es/index.mjs.map +1 -1
  25. package/build/internal/es/index.typings.d.mts +2 -2
  26. package/build/internal/es/index.typings.mjs +14 -0
  27. package/build/internal/es/index.typings.mjs.map +1 -1
  28. package/build/internal/es/{interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.d.mts → interfaces-premium-v1-custom-charges-provider.public-B8bgSqU_.d.mts} +52 -1
  29. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
- import { p as provideHandlers$1 } from './interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.js';
2
- export { A as AlternativeUri, r as ChargeLimitUpdatedRequest, s as ChargeLimitUpdatedResponse, C as ChargeLineItem, h as ChargesRejectedReason, g as ChargesRejectedRequest, i as ChargesRejectedResponse, u as Context, t as CustomChargesConfig, G as GetChargeLimitRequest, a as GetChargeLimitResponse, w as IdentificationData, x as IdentificationDataIdOneOf, v as IdentityType, I as Intent, n as InvoiceCreatedRequest, q as InvoiceCreatedResponse, o as InvoiceLineItem, L as ListChargesRequest, b as ListChargesResponse, c as ListUsagesRequest, d as ListUsagesRequestIntent, e as ListUsagesResponse, S as SpiBaseUri, f as Usage, k as UsageLineItem, U as UsagePeriod, l as UsagesRejectedReason, j as UsagesRejectedRequest, m as UsagesRejectedResponse } from './interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.js';
1
+ import { p as provideHandlers$1 } from './interfaces-premium-v1-custom-charges-provider.public-Dr4u8ZuA.js';
2
+ export { A as AlternativeUri, u as ChargeLimitUpdatedRequest, v as ChargeLimitUpdatedResponse, e as ChargeLineItem, k as ChargesRejectedReason, j as ChargesRejectedRequest, l as ChargesRejectedResponse, x as Context, w as CustomChargesConfig, C as Cycle, a as CycleType, b as Duration, D as DurationUnit, G as GetChargeLimitRequest, c as GetChargeLimitResponse, z as IdentificationData, B as IdentificationDataIdOneOf, y as IdentityType, I as Intent, r as InvoiceCreatedRequest, t as InvoiceCreatedResponse, s as InvoiceLineItem, L as ListChargesRequest, d as ListChargesResponse, f as ListUsagesRequest, g as ListUsagesRequestIntent, h as ListUsagesResponse, S as SpiBaseUri, i as Usage, n as UsageLineItem, U as UsagePeriod, o as UsagesRejectedReason, m as UsagesRejectedRequest, q as UsagesRejectedResponse } from './interfaces-premium-v1-custom-charges-provider.public-Dr4u8ZuA.js';
3
3
  import { BuildServicePluginDefinition } from '@wix/sdk-types';
4
4
 
5
5
  declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
@@ -21,6 +21,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ChargesRejectedReason: () => ChargesRejectedReason,
24
+ CycleType: () => CycleType,
25
+ DurationUnit: () => DurationUnit,
24
26
  IdentityType: () => IdentityType,
25
27
  Intent: () => Intent,
26
28
  ListUsagesRequestIntent: () => ListUsagesRequestIntent,
@@ -31,6 +33,18 @@ __export(index_exports, {
31
33
  module.exports = __toCommonJS(index_exports);
32
34
 
33
35
  // src/service-plugins-types.ts
36
+ var DurationUnit = /* @__PURE__ */ ((DurationUnit2) => {
37
+ DurationUnit2["DAY"] = "DAY";
38
+ DurationUnit2["WEEK"] = "WEEK";
39
+ DurationUnit2["MONTH"] = "MONTH";
40
+ DurationUnit2["YEAR"] = "YEAR";
41
+ return DurationUnit2;
42
+ })(DurationUnit || {});
43
+ var CycleType = /* @__PURE__ */ ((CycleType2) => {
44
+ CycleType2["ONE_TIME"] = "ONE_TIME";
45
+ CycleType2["RECURRING"] = "RECURRING";
46
+ return CycleType2;
47
+ })(CycleType || {});
34
48
  var Intent = /* @__PURE__ */ ((Intent2) => {
35
49
  Intent2["DISPLAY_ONLY"] = "DISPLAY_ONLY";
36
50
  Intent2["CREATE_INVOICE"] = "CREATE_INVOICE";
@@ -209,6 +223,8 @@ var provideHandlers2 = (0, import_service_plugin_modules.createServicePluginModu
209
223
  // Annotate the CommonJS export names for ESM import in node:
210
224
  0 && (module.exports = {
211
225
  ChargesRejectedReason,
226
+ CycleType,
227
+ DurationUnit,
212
228
  IdentityType,
213
229
  Intent,
214
230
  ListUsagesRequestIntent,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../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 * from './src/service-plugins-types.js';\nexport * from './src/interfaces-premium-v1-custom-charges-provider.context.js';\n","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: 10 charges\n * @maxSize 10\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 * Optional usage window for this charge line item. When provided, the invoice\n * line item shows this period instead of the subscription's billing-cycle dates.\n * Both `startDate` and `endDate` must be supplied together — a partial pair is\n * discarded. `startDate` must not be earlier than January 2010 and must not\n * exceed `endDate`.\n */\n usagePeriod?: UsagePeriod;\n}\n\n/**\n * Represents an optional usage window for a charge or usage line item.\n * Both `startDate` and `endDate` must be supplied together — a partial pair is\n * discarded by Wix. `startDate` must not be earlier than January 2010 and must\n * not exceed `endDate`.\n */\nexport interface UsagePeriod {\n /** Start of the app-provided usage window, in UTC. */\n startDate?: Date | null;\n /** End of the app-provided usage window, in UTC. Must not precede `startDate`. */\n endDate?: Date | null;\n}\n\nexport interface ListUsagesRequest {\n /**\n * ID of the subscription for which Wix retrieves feature usages.\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 * List of counter IDs to get usage quantities for.\n * @maxSize 5\n * @minLength 1\n * @maxLength 100\n */\n counterIds?: string[];\n /**\n * Begin of the period Wix retrieves the app instance's feature usages 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 feature usages 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 usages. */\n intent?: ListUsagesRequestIntent;\n}\n\nexport enum ListUsagesRequestIntent {\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 ListUsagesResponse {\n /**\n * Retrieved feature usages.\n * @maxSize 5\n */\n usages?: Usage[];\n}\n\nexport interface Usage {\n /**\n * ID of the counter for which usage is reported.\n * @minLength 1\n * @maxLength 100\n */\n counterId?: string;\n /** Usage quantity for this feature in integer units. */\n quantity?: number;\n /**\n * Description of the usage.\n * @maxLength 256\n */\n description?: string;\n /**\n * Optional usage window for this usage line item. Reserved for future use —\n * currently not populated by Wix.\n */\n usagePeriod?: UsagePeriod;\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 UsagesRejectedRequest {\n /**\n * ID of the subscription for which Wix hasn't accepted your usage-based 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 calculated charges. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Usage line items that include the counter ID, quantity, unit price, and\n * calculated amount.\n * Max: 5 counter IDs\n * @maxSize 5\n */\n usageLineItems?: UsageLineItem[];\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, maxScale:2 }\n */\n chargeLimit?: string | null;\n /**\n * Information about why Wix has rejected your app's usage-based charges.\n *\n * Max: 20 reasons\n * @maxSize 20\n */\n reasons?: UsagesRejectedReason[];\n}\n\n/** Details about the usage line items. */\nexport interface UsageLineItem {\n /**\n * ID of the counter for which usage is reported.\n * @maxLength 100\n * @minLength 1\n */\n counterId?: string;\n /** Usage quantity for this counter in integer units. */\n quantity?: number;\n /**\n * Price per unit that is linked to the counterId on the related product of the subscription.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n */\n unitPrice?: string;\n /**\n * Calculated charge amount (quantity x unit price) in the currency that's specified in the request.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n */\n amount?: string;\n}\n\nexport enum UsagesRejectedReason {\n /** There is no information about why Wix has rejected the usage-based charges. */\n UNKNOWN = 'UNKNOWN',\n /** The calculated charges from usage data exceed the limit that you may charge the customer per billing cycle. */\n CHARGE_LIMIT_EXCEEDED = 'CHARGE_LIMIT_EXCEEDED',\n}\n\nexport interface UsagesRejectedResponse {}\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 20\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 /** Flag that indicates if charges by usages are enabled */\n listUsagesEnabled?: boolean;\n}\n\n/** Base URI configuration for a service plugin. Wix uses these URIs to call your service plugin methods. */\nexport interface SpiBaseUri {\n /**\n * Base URI for your service plugin. Wix appends each method's path to this URI.\n *\n * For example, to receive requests at `https://my-app.com/v1/my-method`, set this field to `https://my-app.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternative URIs for specific methods. Use these to override the default URI for individual methods. */\n alternativeUris?: AlternativeUri[];\n}\n\n/** Custom URI for the specified service plugin method. */\nexport interface AlternativeUri {\n /**\n * Name of the method to call at the absolute URI, in PascalCase. For example, to call [Get Shipping Rates](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/shipping-rates/shipping-rates-integration-service-plugin/get-shipping-rates) on an alternative URI, specify `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Absolute URI that Wix calls for this method. Wix doesn't append any path to this URI.\n *\n * The URI must begin with `https://`, such as `https://my-app.com/v1/my-custom-method`.\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 ListUsagesRequest,\n ListUsagesResponse,\n ChargesRejectedRequest,\n ChargesRejectedResponse,\n UsagesRejectedRequest,\n UsagesRejectedResponse,\n InvoiceCreatedRequest,\n InvoiceCreatedResponse,\n ChargeLimitUpdatedRequest,\n ChargeLimitUpdatedResponse,\n} from './service-plugins-types.js';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\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 ListUsagesEnvelope {\n request: ListUsagesRequest;\n metadata: Context;\n}\n\nexport interface ChargesRejectedEventEnvelope {\n request: ChargesRejectedRequest;\n metadata: Context;\n}\n\nexport interface UsagesRejectedEventEnvelope {\n request: UsagesRejectedRequest;\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 *\n * > **Note:**\n * > This feature isn't yet available to all users. Your app can have only 1 usage-based plan and no other plans. To add a usage-based plan to your app, [submit a request to add a usage-based plan](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels). */\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 *\n * > **Note:**\n * > This feature isn't yet available to all users. Your app can have only 1 usage-based plan and no other plans. To add a usage-based plan to your app, [submit a request to add a usage-based plan](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels). */\n listCharges(\n payload: ListChargesEnvelope\n ): ListChargesResponse | Promise<ListChargesResponse>;\n\n /**\n *\n * Wix calls this method to retrieve counter usage quantities for a paid instance\n * of your app. This happens when Wix needs to understand how much of each counter\n * a customer has used during a specific period.\n *\n * You must return the usage quantities in integer units for the requested\n * counter IDs. The usage should only reflect consumption that occurred during\n * the period Wix specifies when retrieving the usages. */\n listUsages(\n payload: ListUsagesEnvelope\n ): ListUsagesResponse | Promise<ListUsagesResponse>;\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 doesn't accept the usage-based charges calculated from\n * the usages you've returned in the List Usages method.\n *\n *\n * You aren't allowed to charge a site owner more than the charge limit. Wix\n * calculates charges from your usage data and validates them against the limit.\n * Wix doesn't create an invoice in case the usage-based charges aren't accepted. */\n usagesRejectedEvent(\n payload: UsagesRejectedEventEnvelope\n ): UsagesRejectedResponse | Promise<UsagesRejectedResponse>;\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 = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'charges.usagePeriod.startDate' },\n { path: 'charges.usagePeriod.endDate' },\n ],\n },\n ]);\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: 'listUsages',\n primaryHttpMappingPath: '/v1/usages',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'usages.usagePeriod.startDate' },\n { path: 'usages.usagePeriod.endDate' },\n ],\n },\n ]);\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: 'usagesRejectedEvent',\n primaryHttpMappingPath: '/v1/usages-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> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":"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","names":["provideHandlers","Intent","ListUsagesRequestIntent","ChargesRejectedReason","UsagesRejectedReason","IdentityType","import_timestamp","provideHandlers"]}
1
+ {"version":3,"sources":["../../index.ts","../../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 * from './src/service-plugins-types.js';\nexport * from './src/interfaces-premium-v1-custom-charges-provider.context.js';\n","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 /** Billing cycle the charge limit applies to. */\n cycle?: Cycle;\n}\n\nexport interface Cycle {\n /**\n * Payment type.\n * + `UNKNOWN`: The payment type hasn't been set.\n * + `ONE_TIME`: The reseller pays Wix in a single payment.\n * + `RECURRING`: The reseller pays Wix on a recurring schedule.\n */\n cycleType?: CycleType;\n /** Duration of the billing cycle. Available only for `RECURRING` payments. */\n cycleDuration?: Duration;\n}\n\nexport enum DurationUnit {\n /** day */\n DAY = 'DAY',\n /** week */\n WEEK = 'WEEK',\n /** month */\n MONTH = 'MONTH',\n /** year */\n YEAR = 'YEAR',\n}\n\nexport enum CycleType {\n ONE_TIME = 'ONE_TIME',\n RECURRING = 'RECURRING',\n}\n\nexport interface Duration {\n /** Unit of the billing cycle. */\n unit?: DurationUnit;\n /** Count of units that make up the billing cycle. */\n count?: number;\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: 10 charges\n * @maxSize 10\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 * Optional usage window for this charge line item. When provided, the invoice\n * line item shows this period instead of the subscription's billing-cycle dates.\n * Both `startDate` and `endDate` must be supplied together — a partial pair is\n * discarded. `startDate` must not be earlier than January 2010 and must not\n * exceed `endDate`.\n */\n usagePeriod?: UsagePeriod;\n}\n\n/**\n * Represents an optional usage window for a charge or usage line item.\n * Both `startDate` and `endDate` must be supplied together — a partial pair is\n * discarded by Wix. `startDate` must not be earlier than January 2010 and must\n * not exceed `endDate`.\n */\nexport interface UsagePeriod {\n /** Start of the app-provided usage window, in UTC. */\n startDate?: Date | null;\n /** End of the app-provided usage window, in UTC. Must not precede `startDate`. */\n endDate?: Date | null;\n}\n\nexport interface ListUsagesRequest {\n /**\n * ID of the subscription for which Wix retrieves feature usages.\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 * List of counter IDs to get usage quantities for.\n * @maxSize 5\n * @minLength 1\n * @maxLength 100\n */\n counterIds?: string[];\n /**\n * Begin of the period Wix retrieves the app instance's feature usages 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 feature usages 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 usages. */\n intent?: ListUsagesRequestIntent;\n}\n\nexport enum ListUsagesRequestIntent {\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 ListUsagesResponse {\n /**\n * Retrieved feature usages.\n * @maxSize 5\n */\n usages?: Usage[];\n}\n\nexport interface Usage {\n /**\n * ID of the counter for which usage is reported.\n * @minLength 1\n * @maxLength 100\n */\n counterId?: string;\n /** Usage quantity for this feature in integer units. */\n quantity?: number;\n /**\n * Description of the usage.\n * @maxLength 256\n */\n description?: string;\n /**\n * Optional usage window for this usage line item. Reserved for future use —\n * currently not populated by Wix.\n */\n usagePeriod?: UsagePeriod;\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 UsagesRejectedRequest {\n /**\n * ID of the subscription for which Wix hasn't accepted your usage-based 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 calculated charges. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Usage line items that include the counter ID, quantity, unit price, and\n * calculated amount.\n * Max: 5 counter IDs\n * @maxSize 5\n */\n usageLineItems?: UsageLineItem[];\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, maxScale:2 }\n */\n chargeLimit?: string | null;\n /**\n * Information about why Wix has rejected your app's usage-based charges.\n *\n * Max: 20 reasons\n * @maxSize 20\n */\n reasons?: UsagesRejectedReason[];\n}\n\n/** Details about the usage line items. */\nexport interface UsageLineItem {\n /**\n * ID of the counter for which usage is reported.\n * @maxLength 100\n * @minLength 1\n */\n counterId?: string;\n /** Usage quantity for this counter in integer units. */\n quantity?: number;\n /**\n * Price per unit that is linked to the counterId on the related product of the subscription.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n */\n unitPrice?: string;\n /**\n * Calculated charge amount (quantity x unit price) in the currency that's specified in the request.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n */\n amount?: string;\n}\n\nexport enum UsagesRejectedReason {\n /** There is no information about why Wix has rejected the usage-based charges. */\n UNKNOWN = 'UNKNOWN',\n /** The calculated charges from usage data exceed the limit that you may charge the customer per billing cycle. */\n CHARGE_LIMIT_EXCEEDED = 'CHARGE_LIMIT_EXCEEDED',\n}\n\nexport interface UsagesRejectedResponse {}\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 20\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 /** Flag that indicates if charges by usages are enabled */\n listUsagesEnabled?: boolean;\n}\n\n/** Base URI configuration for a service plugin. Wix uses these URIs to call your service plugin methods. */\nexport interface SpiBaseUri {\n /**\n * Base URI for your service plugin. Wix appends each method's path to this URI.\n *\n * For example, to receive requests at `https://my-app.com/v1/my-method`, set this field to `https://my-app.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternative URIs for specific methods. Use these to override the default URI for individual methods. */\n alternativeUris?: AlternativeUri[];\n}\n\n/** Custom URI for the specified service plugin method. */\nexport interface AlternativeUri {\n /**\n * Name of the method to call at the absolute URI, in PascalCase. For example, to call [Get Shipping Rates](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/shipping-rates/shipping-rates-integration-service-plugin/get-shipping-rates) on an alternative URI, specify `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Absolute URI that Wix calls for this method. Wix doesn't append any path to this URI.\n *\n * The URI must begin with `https://`, such as `https://my-app.com/v1/my-custom-method`.\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 * Extension ID in Dev Center.\n * @internal\n * @maxLength 256\n */\n appExtensionId?: string | null;\n /**\n * Extension type in Dev Center.\n * @internal\n * @maxLength 256\n */\n appExtensionType?: string | null;\n /**\n * Invoked function.\n * @internal\n * @maxLength 256\n */\n functionName?: 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 ListUsagesRequest,\n ListUsagesResponse,\n ChargesRejectedRequest,\n ChargesRejectedResponse,\n UsagesRejectedRequest,\n UsagesRejectedResponse,\n InvoiceCreatedRequest,\n InvoiceCreatedResponse,\n ChargeLimitUpdatedRequest,\n ChargeLimitUpdatedResponse,\n} from './service-plugins-types.js';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\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 ListUsagesEnvelope {\n request: ListUsagesRequest;\n metadata: Context;\n}\n\nexport interface ChargesRejectedEventEnvelope {\n request: ChargesRejectedRequest;\n metadata: Context;\n}\n\nexport interface UsagesRejectedEventEnvelope {\n request: UsagesRejectedRequest;\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 *\n * > **Note:**\n * > This feature isn't yet available to all users. Your app can have only 1 usage-based plan and no other plans. To add a usage-based plan to your app, [submit a request to add a usage-based plan](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels). */\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 *\n * > **Note:**\n * > This feature isn't yet available to all users. Your app can have only 1 usage-based plan and no other plans. To add a usage-based plan to your app, [submit a request to add a usage-based plan](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels). */\n listCharges(\n payload: ListChargesEnvelope\n ): ListChargesResponse | Promise<ListChargesResponse>;\n\n /**\n *\n * Wix calls this method to retrieve counter usage quantities for a paid instance\n * of your app. This happens when Wix needs to understand how much of each counter\n * a customer has used during a specific period.\n *\n * You must return the usage quantities in integer units for the requested\n * counter IDs. The usage should only reflect consumption that occurred during\n * the period Wix specifies when retrieving the usages. */\n listUsages(\n payload: ListUsagesEnvelope\n ): ListUsagesResponse | Promise<ListUsagesResponse>;\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 doesn't accept the usage-based charges calculated from\n * the usages you've returned in the List Usages method.\n *\n *\n * You aren't allowed to charge a site owner more than the charge limit. Wix\n * calculates charges from your usage data and validates them against the limit.\n * Wix doesn't create an invoice in case the usage-based charges aren't accepted. */\n usagesRejectedEvent(\n payload: UsagesRejectedEventEnvelope\n ): UsagesRejectedResponse | Promise<UsagesRejectedResponse>;\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 = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'charges.usagePeriod.startDate' },\n { path: 'charges.usagePeriod.endDate' },\n ],\n },\n ]);\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: 'listUsages',\n primaryHttpMappingPath: '/v1/usages',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'usages.usagePeriod.startDate' },\n { path: 'usages.usagePeriod.endDate' },\n ],\n },\n ]);\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: 'usagesRejectedEvent',\n primaryHttpMappingPath: '/v1/usages-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> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":"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","names":["provideHandlers","DurationUnit","CycleType","Intent","ListUsagesRequestIntent","ChargesRejectedReason","UsagesRejectedReason","IdentityType","import_timestamp","provideHandlers"]}
@@ -1,5 +1,5 @@
1
- import { y as GetChargeLimitEnvelope, a as GetChargeLimitResponse, z as ListChargesEnvelope, b as ListChargesResponse, B as ListUsagesEnvelope, e as ListUsagesResponse, D as ChargesRejectedEventEnvelope, i as ChargesRejectedResponse, E as UsagesRejectedEventEnvelope, m as UsagesRejectedResponse, F as InvoiceCreatedEventEnvelope, q as InvoiceCreatedResponse, H as ChargeLimitUpdatedEventEnvelope, s as ChargeLimitUpdatedResponse } from './interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.js';
2
- export { A as AlternativeUri, r as ChargeLimitUpdatedRequest, C as ChargeLineItem, h as ChargesRejectedReason, g as ChargesRejectedRequest, u as Context, t as CustomChargesConfig, G as GetChargeLimitRequest, w as IdentificationData, x as IdentificationDataIdOneOf, v as IdentityType, I as Intent, n as InvoiceCreatedRequest, o as InvoiceLineItem, L as ListChargesRequest, c as ListUsagesRequest, d as ListUsagesRequestIntent, S as SpiBaseUri, f as Usage, k as UsageLineItem, U as UsagePeriod, l as UsagesRejectedReason, j as UsagesRejectedRequest } from './interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.js';
1
+ import { E as GetChargeLimitEnvelope, c as GetChargeLimitResponse, F as ListChargesEnvelope, d as ListChargesResponse, H as ListUsagesEnvelope, h as ListUsagesResponse, J as ChargesRejectedEventEnvelope, l as ChargesRejectedResponse, K as UsagesRejectedEventEnvelope, q as UsagesRejectedResponse, M as InvoiceCreatedEventEnvelope, t as InvoiceCreatedResponse, N as ChargeLimitUpdatedEventEnvelope, v as ChargeLimitUpdatedResponse } from './interfaces-premium-v1-custom-charges-provider.public-Dr4u8ZuA.js';
2
+ export { A as AlternativeUri, u as ChargeLimitUpdatedRequest, e as ChargeLineItem, k as ChargesRejectedReason, j as ChargesRejectedRequest, x as Context, w as CustomChargesConfig, C as Cycle, a as CycleType, b as Duration, D as DurationUnit, G as GetChargeLimitRequest, z as IdentificationData, B as IdentificationDataIdOneOf, y as IdentityType, I as Intent, r as InvoiceCreatedRequest, s as InvoiceLineItem, L as ListChargesRequest, f as ListUsagesRequest, g as ListUsagesRequestIntent, S as SpiBaseUri, i as Usage, n as UsageLineItem, U as UsagePeriod, o as UsagesRejectedReason, m as UsagesRejectedRequest } from './interfaces-premium-v1-custom-charges-provider.public-Dr4u8ZuA.js';
3
3
  import '@wix/sdk-types';
4
4
 
5
5
  /**
@@ -21,6 +21,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_typings_exports = {};
22
22
  __export(index_typings_exports, {
23
23
  ChargesRejectedReason: () => ChargesRejectedReason,
24
+ CycleType: () => CycleType,
25
+ DurationUnit: () => DurationUnit,
24
26
  IdentityType: () => IdentityType,
25
27
  Intent: () => Intent,
26
28
  ListUsagesRequestIntent: () => ListUsagesRequestIntent,
@@ -29,6 +31,18 @@ __export(index_typings_exports, {
29
31
  module.exports = __toCommonJS(index_typings_exports);
30
32
 
31
33
  // src/service-plugins-types.ts
34
+ var DurationUnit = /* @__PURE__ */ ((DurationUnit2) => {
35
+ DurationUnit2["DAY"] = "DAY";
36
+ DurationUnit2["WEEK"] = "WEEK";
37
+ DurationUnit2["MONTH"] = "MONTH";
38
+ DurationUnit2["YEAR"] = "YEAR";
39
+ return DurationUnit2;
40
+ })(DurationUnit || {});
41
+ var CycleType = /* @__PURE__ */ ((CycleType2) => {
42
+ CycleType2["ONE_TIME"] = "ONE_TIME";
43
+ CycleType2["RECURRING"] = "RECURRING";
44
+ return CycleType2;
45
+ })(CycleType || {});
32
46
  var Intent = /* @__PURE__ */ ((Intent2) => {
33
47
  Intent2["DISPLAY_ONLY"] = "DISPLAY_ONLY";
34
48
  Intent2["CREATE_INVOICE"] = "CREATE_INVOICE";
@@ -62,6 +76,8 @@ var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
62
76
  // Annotate the CommonJS export names for ESM import in node:
63
77
  0 && (module.exports = {
64
78
  ChargesRejectedReason,
79
+ CycleType,
80
+ DurationUnit,
65
81
  IdentityType,
66
82
  Intent,
67
83
  ListUsagesRequestIntent,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import {\n GetChargeLimitResponse,\n ListChargesResponse,\n ListUsagesResponse,\n ChargesRejectedResponse,\n UsagesRejectedResponse,\n InvoiceCreatedResponse,\n ChargeLimitUpdatedResponse,\n} from './src/service-plugins-types.js';\nimport {\n GetChargeLimitEnvelope,\n ListChargesEnvelope,\n ListUsagesEnvelope,\n ChargesRejectedEventEnvelope,\n UsagesRejectedEventEnvelope,\n InvoiceCreatedEventEnvelope,\n ChargeLimitUpdatedEventEnvelope,\n} from './src/interfaces-premium-v1-custom-charges-provider.public.js';\n\nexport * from './src/service-plugins-types';\nexport {\n GetChargeLimitEnvelope,\n ListChargesEnvelope,\n ListUsagesEnvelope,\n ChargesRejectedEventEnvelope,\n UsagesRejectedEventEnvelope,\n InvoiceCreatedEventEnvelope,\n ChargeLimitUpdatedEventEnvelope,\n};\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 *\n * > **Note:**\n * > This feature isn't yet available to all users. Your app can have only 1 usage-based plan and no other plans. To add a usage-based plan to your app, [submit a request to add a usage-based plan](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels).\n */\nexport declare function getChargeLimit(\n payload: GetChargeLimitEnvelope\n): GetChargeLimitResponse | Promise<GetChargeLimitResponse>;\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 *\n * > **Note:**\n * > This feature isn't yet available to all users. Your app can have only 1 usage-based plan and no other plans. To add a usage-based plan to your app, [submit a request to add a usage-based plan](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels).\n */\nexport declare function listCharges(\n payload: ListChargesEnvelope\n): ListChargesResponse | Promise<ListChargesResponse>;\n/**\n * Wix calls this method to retrieve counter usage quantities for a paid instance\n * of your app. This happens when Wix needs to understand how much of each counter\n * a customer has used during a specific period.\n *\n * You must return the usage quantities in integer units for the requested\n * counter IDs. The usage should only reflect consumption that occurred during\n * the period Wix specifies when retrieving the usages.\n */\nexport declare function listUsages(\n payload: ListUsagesEnvelope\n): ListUsagesResponse | Promise<ListUsagesResponse>;\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 */\nexport declare function chargesRejectedEvent(\n payload: ChargesRejectedEventEnvelope\n): ChargesRejectedResponse | Promise<ChargesRejectedResponse>;\n/**\n * Triggered in case Wix doesn't accept the usage-based charges calculated from\n * the usages you've returned in the List Usages method.\n *\n *\n * You aren't allowed to charge a site owner more than the charge limit. Wix\n * calculates charges from your usage data and validates them against the limit.\n * Wix doesn't create an invoice in case the usage-based charges aren't accepted.\n */\nexport declare function usagesRejectedEvent(\n payload: UsagesRejectedEventEnvelope\n): UsagesRejectedResponse | Promise<UsagesRejectedResponse>;\n/**\n * Triggered in case Wix creates an invoice that includes charges for an instance\n * of your app.\n */\nexport declare function invoiceCreatedEvent(\n payload: InvoiceCreatedEventEnvelope\n): InvoiceCreatedResponse | Promise<InvoiceCreatedResponse>;\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 */\nexport declare function chargeLimitUpdatedEvent(\n payload: ChargeLimitUpdatedEventEnvelope\n): ChargeLimitUpdatedResponse | Promise<ChargeLimitUpdatedResponse>;\n","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: 10 charges\n * @maxSize 10\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 * Optional usage window for this charge line item. When provided, the invoice\n * line item shows this period instead of the subscription's billing-cycle dates.\n * Both `startDate` and `endDate` must be supplied together — a partial pair is\n * discarded. `startDate` must not be earlier than January 2010 and must not\n * exceed `endDate`.\n */\n usagePeriod?: UsagePeriod;\n}\n\n/**\n * Represents an optional usage window for a charge or usage line item.\n * Both `startDate` and `endDate` must be supplied together — a partial pair is\n * discarded by Wix. `startDate` must not be earlier than January 2010 and must\n * not exceed `endDate`.\n */\nexport interface UsagePeriod {\n /** Start of the app-provided usage window, in UTC. */\n startDate?: Date | null;\n /** End of the app-provided usage window, in UTC. Must not precede `startDate`. */\n endDate?: Date | null;\n}\n\nexport interface ListUsagesRequest {\n /**\n * ID of the subscription for which Wix retrieves feature usages.\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 * List of counter IDs to get usage quantities for.\n * @maxSize 5\n * @minLength 1\n * @maxLength 100\n */\n counterIds?: string[];\n /**\n * Begin of the period Wix retrieves the app instance's feature usages 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 feature usages 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 usages. */\n intent?: ListUsagesRequestIntent;\n}\n\nexport enum ListUsagesRequestIntent {\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 ListUsagesResponse {\n /**\n * Retrieved feature usages.\n * @maxSize 5\n */\n usages?: Usage[];\n}\n\nexport interface Usage {\n /**\n * ID of the counter for which usage is reported.\n * @minLength 1\n * @maxLength 100\n */\n counterId?: string;\n /** Usage quantity for this feature in integer units. */\n quantity?: number;\n /**\n * Description of the usage.\n * @maxLength 256\n */\n description?: string;\n /**\n * Optional usage window for this usage line item. Reserved for future use —\n * currently not populated by Wix.\n */\n usagePeriod?: UsagePeriod;\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 UsagesRejectedRequest {\n /**\n * ID of the subscription for which Wix hasn't accepted your usage-based 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 calculated charges. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Usage line items that include the counter ID, quantity, unit price, and\n * calculated amount.\n * Max: 5 counter IDs\n * @maxSize 5\n */\n usageLineItems?: UsageLineItem[];\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, maxScale:2 }\n */\n chargeLimit?: string | null;\n /**\n * Information about why Wix has rejected your app's usage-based charges.\n *\n * Max: 20 reasons\n * @maxSize 20\n */\n reasons?: UsagesRejectedReason[];\n}\n\n/** Details about the usage line items. */\nexport interface UsageLineItem {\n /**\n * ID of the counter for which usage is reported.\n * @maxLength 100\n * @minLength 1\n */\n counterId?: string;\n /** Usage quantity for this counter in integer units. */\n quantity?: number;\n /**\n * Price per unit that is linked to the counterId on the related product of the subscription.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n */\n unitPrice?: string;\n /**\n * Calculated charge amount (quantity x unit price) in the currency that's specified in the request.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n */\n amount?: string;\n}\n\nexport enum UsagesRejectedReason {\n /** There is no information about why Wix has rejected the usage-based charges. */\n UNKNOWN = 'UNKNOWN',\n /** The calculated charges from usage data exceed the limit that you may charge the customer per billing cycle. */\n CHARGE_LIMIT_EXCEEDED = 'CHARGE_LIMIT_EXCEEDED',\n}\n\nexport interface UsagesRejectedResponse {}\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 20\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 /** Flag that indicates if charges by usages are enabled */\n listUsagesEnabled?: boolean;\n}\n\n/** Base URI configuration for a service plugin. Wix uses these URIs to call your service plugin methods. */\nexport interface SpiBaseUri {\n /**\n * Base URI for your service plugin. Wix appends each method's path to this URI.\n *\n * For example, to receive requests at `https://my-app.com/v1/my-method`, set this field to `https://my-app.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternative URIs for specific methods. Use these to override the default URI for individual methods. */\n alternativeUris?: AlternativeUri[];\n}\n\n/** Custom URI for the specified service plugin method. */\nexport interface AlternativeUri {\n /**\n * Name of the method to call at the absolute URI, in PascalCase. For example, to call [Get Shipping Rates](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/shipping-rates/shipping-rates-integration-service-plugin/get-shipping-rates) on an alternative URI, specify `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Absolute URI that Wix calls for this method. Wix doesn't append any path to this URI.\n *\n * The URI must begin with `https://`, such as `https://my-app.com/v1/my-custom-method`.\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC8DO,IAAK,SAAL,kBAAKA,YAAL;AAEL,EAAAA,QAAA,kBAAe;AAEf,EAAAA,QAAA,oBAAiB;AAJP,SAAAA;AAAA,GAAA;AA2FL,IAAK,0BAAL,kBAAKC,6BAAL;AAEL,EAAAA,yBAAA,kBAAe;AAEf,EAAAA,yBAAA,oBAAiB;AAJP,SAAAA;AAAA,GAAA;AA6EL,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,aAAU;AAEV,EAAAA,uBAAA,2BAAwB;AAExB,EAAAA,uBAAA,sBAAmB;AAEnB,EAAAA,uBAAA,oBAAiB;AARP,SAAAA;AAAA,GAAA;AA8EL,IAAK,uBAAL,kBAAKC,0BAAL;AAEL,EAAAA,sBAAA,aAAU;AAEV,EAAAA,sBAAA,2BAAwB;AAJd,SAAAA;AAAA,GAAA;AA+JL,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;","names":["Intent","ListUsagesRequestIntent","ChargesRejectedReason","UsagesRejectedReason","IdentityType"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import {\n GetChargeLimitResponse,\n ListChargesResponse,\n ListUsagesResponse,\n ChargesRejectedResponse,\n UsagesRejectedResponse,\n InvoiceCreatedResponse,\n ChargeLimitUpdatedResponse,\n} from './src/service-plugins-types.js';\nimport {\n GetChargeLimitEnvelope,\n ListChargesEnvelope,\n ListUsagesEnvelope,\n ChargesRejectedEventEnvelope,\n UsagesRejectedEventEnvelope,\n InvoiceCreatedEventEnvelope,\n ChargeLimitUpdatedEventEnvelope,\n} from './src/interfaces-premium-v1-custom-charges-provider.public.js';\n\nexport * from './src/service-plugins-types';\nexport {\n GetChargeLimitEnvelope,\n ListChargesEnvelope,\n ListUsagesEnvelope,\n ChargesRejectedEventEnvelope,\n UsagesRejectedEventEnvelope,\n InvoiceCreatedEventEnvelope,\n ChargeLimitUpdatedEventEnvelope,\n};\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 *\n * > **Note:**\n * > This feature isn't yet available to all users. Your app can have only 1 usage-based plan and no other plans. To add a usage-based plan to your app, [submit a request to add a usage-based plan](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels).\n */\nexport declare function getChargeLimit(\n payload: GetChargeLimitEnvelope\n): GetChargeLimitResponse | Promise<GetChargeLimitResponse>;\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 *\n * > **Note:**\n * > This feature isn't yet available to all users. Your app can have only 1 usage-based plan and no other plans. To add a usage-based plan to your app, [submit a request to add a usage-based plan](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels).\n */\nexport declare function listCharges(\n payload: ListChargesEnvelope\n): ListChargesResponse | Promise<ListChargesResponse>;\n/**\n * Wix calls this method to retrieve counter usage quantities for a paid instance\n * of your app. This happens when Wix needs to understand how much of each counter\n * a customer has used during a specific period.\n *\n * You must return the usage quantities in integer units for the requested\n * counter IDs. The usage should only reflect consumption that occurred during\n * the period Wix specifies when retrieving the usages.\n */\nexport declare function listUsages(\n payload: ListUsagesEnvelope\n): ListUsagesResponse | Promise<ListUsagesResponse>;\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 */\nexport declare function chargesRejectedEvent(\n payload: ChargesRejectedEventEnvelope\n): ChargesRejectedResponse | Promise<ChargesRejectedResponse>;\n/**\n * Triggered in case Wix doesn't accept the usage-based charges calculated from\n * the usages you've returned in the List Usages method.\n *\n *\n * You aren't allowed to charge a site owner more than the charge limit. Wix\n * calculates charges from your usage data and validates them against the limit.\n * Wix doesn't create an invoice in case the usage-based charges aren't accepted.\n */\nexport declare function usagesRejectedEvent(\n payload: UsagesRejectedEventEnvelope\n): UsagesRejectedResponse | Promise<UsagesRejectedResponse>;\n/**\n * Triggered in case Wix creates an invoice that includes charges for an instance\n * of your app.\n */\nexport declare function invoiceCreatedEvent(\n payload: InvoiceCreatedEventEnvelope\n): InvoiceCreatedResponse | Promise<InvoiceCreatedResponse>;\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 */\nexport declare function chargeLimitUpdatedEvent(\n payload: ChargeLimitUpdatedEventEnvelope\n): ChargeLimitUpdatedResponse | Promise<ChargeLimitUpdatedResponse>;\n","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 /** Billing cycle the charge limit applies to. */\n cycle?: Cycle;\n}\n\nexport interface Cycle {\n /**\n * Payment type.\n * + `UNKNOWN`: The payment type hasn't been set.\n * + `ONE_TIME`: The reseller pays Wix in a single payment.\n * + `RECURRING`: The reseller pays Wix on a recurring schedule.\n */\n cycleType?: CycleType;\n /** Duration of the billing cycle. Available only for `RECURRING` payments. */\n cycleDuration?: Duration;\n}\n\nexport enum DurationUnit {\n /** day */\n DAY = 'DAY',\n /** week */\n WEEK = 'WEEK',\n /** month */\n MONTH = 'MONTH',\n /** year */\n YEAR = 'YEAR',\n}\n\nexport enum CycleType {\n ONE_TIME = 'ONE_TIME',\n RECURRING = 'RECURRING',\n}\n\nexport interface Duration {\n /** Unit of the billing cycle. */\n unit?: DurationUnit;\n /** Count of units that make up the billing cycle. */\n count?: number;\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: 10 charges\n * @maxSize 10\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 * Optional usage window for this charge line item. When provided, the invoice\n * line item shows this period instead of the subscription's billing-cycle dates.\n * Both `startDate` and `endDate` must be supplied together — a partial pair is\n * discarded. `startDate` must not be earlier than January 2010 and must not\n * exceed `endDate`.\n */\n usagePeriod?: UsagePeriod;\n}\n\n/**\n * Represents an optional usage window for a charge or usage line item.\n * Both `startDate` and `endDate` must be supplied together — a partial pair is\n * discarded by Wix. `startDate` must not be earlier than January 2010 and must\n * not exceed `endDate`.\n */\nexport interface UsagePeriod {\n /** Start of the app-provided usage window, in UTC. */\n startDate?: Date | null;\n /** End of the app-provided usage window, in UTC. Must not precede `startDate`. */\n endDate?: Date | null;\n}\n\nexport interface ListUsagesRequest {\n /**\n * ID of the subscription for which Wix retrieves feature usages.\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 * List of counter IDs to get usage quantities for.\n * @maxSize 5\n * @minLength 1\n * @maxLength 100\n */\n counterIds?: string[];\n /**\n * Begin of the period Wix retrieves the app instance's feature usages 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 feature usages 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 usages. */\n intent?: ListUsagesRequestIntent;\n}\n\nexport enum ListUsagesRequestIntent {\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 ListUsagesResponse {\n /**\n * Retrieved feature usages.\n * @maxSize 5\n */\n usages?: Usage[];\n}\n\nexport interface Usage {\n /**\n * ID of the counter for which usage is reported.\n * @minLength 1\n * @maxLength 100\n */\n counterId?: string;\n /** Usage quantity for this feature in integer units. */\n quantity?: number;\n /**\n * Description of the usage.\n * @maxLength 256\n */\n description?: string;\n /**\n * Optional usage window for this usage line item. Reserved for future use —\n * currently not populated by Wix.\n */\n usagePeriod?: UsagePeriod;\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 UsagesRejectedRequest {\n /**\n * ID of the subscription for which Wix hasn't accepted your usage-based 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 calculated charges. Wix may add supported currencies in the future.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Usage line items that include the counter ID, quantity, unit price, and\n * calculated amount.\n * Max: 5 counter IDs\n * @maxSize 5\n */\n usageLineItems?: UsageLineItem[];\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, maxScale:2 }\n */\n chargeLimit?: string | null;\n /**\n * Information about why Wix has rejected your app's usage-based charges.\n *\n * Max: 20 reasons\n * @maxSize 20\n */\n reasons?: UsagesRejectedReason[];\n}\n\n/** Details about the usage line items. */\nexport interface UsageLineItem {\n /**\n * ID of the counter for which usage is reported.\n * @maxLength 100\n * @minLength 1\n */\n counterId?: string;\n /** Usage quantity for this counter in integer units. */\n quantity?: number;\n /**\n * Price per unit that is linked to the counterId on the related product of the subscription.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n */\n unitPrice?: string;\n /**\n * Calculated charge amount (quantity x unit price) in the currency that's specified in the request.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n */\n amount?: string;\n}\n\nexport enum UsagesRejectedReason {\n /** There is no information about why Wix has rejected the usage-based charges. */\n UNKNOWN = 'UNKNOWN',\n /** The calculated charges from usage data exceed the limit that you may charge the customer per billing cycle. */\n CHARGE_LIMIT_EXCEEDED = 'CHARGE_LIMIT_EXCEEDED',\n}\n\nexport interface UsagesRejectedResponse {}\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 20\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 /** Flag that indicates if charges by usages are enabled */\n listUsagesEnabled?: boolean;\n}\n\n/** Base URI configuration for a service plugin. Wix uses these URIs to call your service plugin methods. */\nexport interface SpiBaseUri {\n /**\n * Base URI for your service plugin. Wix appends each method's path to this URI.\n *\n * For example, to receive requests at `https://my-app.com/v1/my-method`, set this field to `https://my-app.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternative URIs for specific methods. Use these to override the default URI for individual methods. */\n alternativeUris?: AlternativeUri[];\n}\n\n/** Custom URI for the specified service plugin method. */\nexport interface AlternativeUri {\n /**\n * Name of the method to call at the absolute URI, in PascalCase. For example, to call [Get Shipping Rates](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/shipping-rates/shipping-rates-integration-service-plugin/get-shipping-rates) on an alternative URI, specify `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Absolute URI that Wix calls for this method. Wix doesn't append any path to this URI.\n *\n * The URI must begin with `https://`, such as `https://my-app.com/v1/my-custom-method`.\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 * Extension ID in Dev Center.\n * @internal\n * @maxLength 256\n */\n appExtensionId?: string | null;\n /**\n * Extension type in Dev Center.\n * @internal\n * @maxLength 256\n */\n appExtensionType?: string | null;\n /**\n * Invoked function.\n * @internal\n * @maxLength 256\n */\n functionName?: 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkCO,IAAK,eAAL,kBAAKA,kBAAL;AAEL,EAAAA,cAAA,SAAM;AAEN,EAAAA,cAAA,UAAO;AAEP,EAAAA,cAAA,WAAQ;AAER,EAAAA,cAAA,UAAO;AARG,SAAAA;AAAA,GAAA;AAWL,IAAK,YAAL,kBAAKC,eAAL;AACL,EAAAA,WAAA,cAAW;AACX,EAAAA,WAAA,eAAY;AAFF,SAAAA;AAAA,GAAA;AAsDL,IAAK,SAAL,kBAAKC,YAAL;AAEL,EAAAA,QAAA,kBAAe;AAEf,EAAAA,QAAA,oBAAiB;AAJP,SAAAA;AAAA,GAAA;AA2FL,IAAK,0BAAL,kBAAKC,6BAAL;AAEL,EAAAA,yBAAA,kBAAe;AAEf,EAAAA,yBAAA,oBAAiB;AAJP,SAAAA;AAAA,GAAA;AA6EL,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,aAAU;AAEV,EAAAA,uBAAA,2BAAwB;AAExB,EAAAA,uBAAA,sBAAmB;AAEnB,EAAAA,uBAAA,oBAAiB;AARP,SAAAA;AAAA,GAAA;AA8EL,IAAK,uBAAL,kBAAKC,0BAAL;AAEL,EAAAA,sBAAA,aAAU;AAEV,EAAAA,sBAAA,2BAAwB;AAJd,SAAAA;AAAA,GAAA;AAiLL,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;","names":["DurationUnit","CycleType","Intent","ListUsagesRequestIntent","ChargesRejectedReason","UsagesRejectedReason","IdentityType"]}
@@ -18,6 +18,39 @@ interface GetChargeLimitRequest {
18
18
  * @format CURRENCY
19
19
  */
20
20
  currency?: string;
21
+ /** Billing cycle the charge limit applies to. */
22
+ cycle?: Cycle;
23
+ }
24
+ interface Cycle {
25
+ /**
26
+ * Payment type.
27
+ * + `UNKNOWN`: The payment type hasn't been set.
28
+ * + `ONE_TIME`: The reseller pays Wix in a single payment.
29
+ * + `RECURRING`: The reseller pays Wix on a recurring schedule.
30
+ */
31
+ cycleType?: CycleType;
32
+ /** Duration of the billing cycle. Available only for `RECURRING` payments. */
33
+ cycleDuration?: Duration;
34
+ }
35
+ declare enum DurationUnit {
36
+ /** day */
37
+ DAY = "DAY",
38
+ /** week */
39
+ WEEK = "WEEK",
40
+ /** month */
41
+ MONTH = "MONTH",
42
+ /** year */
43
+ YEAR = "YEAR"
44
+ }
45
+ declare enum CycleType {
46
+ ONE_TIME = "ONE_TIME",
47
+ RECURRING = "RECURRING"
48
+ }
49
+ interface Duration {
50
+ /** Unit of the billing cycle. */
51
+ unit?: DurationUnit;
52
+ /** Count of units that make up the billing cycle. */
53
+ count?: number;
21
54
  }
22
55
  interface GetChargeLimitResponse {
23
56
  /**
@@ -611,4 +644,4 @@ declare const provideHandlers: ServicePluginDefinition<{
611
644
  chargeLimitUpdatedEvent(payload: ChargeLimitUpdatedEventEnvelope): ChargeLimitUpdatedResponse | Promise<ChargeLimitUpdatedResponse>;
612
645
  }>;
613
646
 
614
- export { type AlternativeUri as A, type ListUsagesEnvelope as B, type ChargeLineItem as C, type ChargesRejectedEventEnvelope as D, type UsagesRejectedEventEnvelope as E, type InvoiceCreatedEventEnvelope as F, type GetChargeLimitRequest as G, type ChargeLimitUpdatedEventEnvelope as H, Intent as I, type ListChargesRequest as L, type SpiBaseUri as S, type UsagePeriod as U, type GetChargeLimitResponse as a, type ListChargesResponse as b, type ListUsagesRequest as c, ListUsagesRequestIntent as d, type ListUsagesResponse as e, type Usage as f, type ChargesRejectedRequest as g, ChargesRejectedReason as h, type ChargesRejectedResponse as i, type UsagesRejectedRequest as j, type UsageLineItem as k, UsagesRejectedReason as l, type UsagesRejectedResponse as m, type InvoiceCreatedRequest as n, type InvoiceLineItem as o, provideHandlers as p, type InvoiceCreatedResponse as q, type ChargeLimitUpdatedRequest as r, type ChargeLimitUpdatedResponse as s, type CustomChargesConfig as t, type Context as u, IdentityType as v, type IdentificationData as w, type IdentificationDataIdOneOf as x, type GetChargeLimitEnvelope as y, type ListChargesEnvelope as z };
647
+ export { type AlternativeUri as A, type IdentificationDataIdOneOf as B, type Cycle as C, DurationUnit as D, type GetChargeLimitEnvelope as E, type ListChargesEnvelope as F, type GetChargeLimitRequest as G, type ListUsagesEnvelope as H, Intent as I, type ChargesRejectedEventEnvelope as J, type UsagesRejectedEventEnvelope as K, type ListChargesRequest as L, type InvoiceCreatedEventEnvelope as M, type ChargeLimitUpdatedEventEnvelope as N, type SpiBaseUri as S, type UsagePeriod as U, CycleType as a, type Duration as b, type GetChargeLimitResponse as c, type ListChargesResponse as d, type ChargeLineItem as e, type ListUsagesRequest as f, ListUsagesRequestIntent as g, type ListUsagesResponse as h, type Usage as i, type ChargesRejectedRequest as j, ChargesRejectedReason as k, type ChargesRejectedResponse as l, type UsagesRejectedRequest as m, type UsageLineItem as n, UsagesRejectedReason as o, provideHandlers as p, type UsagesRejectedResponse as q, type InvoiceCreatedRequest as r, type InvoiceLineItem as s, type InvoiceCreatedResponse as t, type ChargeLimitUpdatedRequest as u, type ChargeLimitUpdatedResponse as v, type CustomChargesConfig as w, type Context as x, IdentityType as y, type IdentificationData as z };
@@ -1,5 +1,5 @@
1
- import { p as provideHandlers$1 } from './interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.mjs';
2
- export { A as AlternativeUri, r as ChargeLimitUpdatedRequest, s as ChargeLimitUpdatedResponse, C as ChargeLineItem, h as ChargesRejectedReason, g as ChargesRejectedRequest, i as ChargesRejectedResponse, u as Context, t as CustomChargesConfig, G as GetChargeLimitRequest, a as GetChargeLimitResponse, w as IdentificationData, x as IdentificationDataIdOneOf, v as IdentityType, I as Intent, n as InvoiceCreatedRequest, q as InvoiceCreatedResponse, o as InvoiceLineItem, L as ListChargesRequest, b as ListChargesResponse, c as ListUsagesRequest, d as ListUsagesRequestIntent, e as ListUsagesResponse, S as SpiBaseUri, f as Usage, k as UsageLineItem, U as UsagePeriod, l as UsagesRejectedReason, j as UsagesRejectedRequest, m as UsagesRejectedResponse } from './interfaces-premium-v1-custom-charges-provider.public--9TFAQZG.mjs';
1
+ import { p as provideHandlers$1 } from './interfaces-premium-v1-custom-charges-provider.public-Dr4u8ZuA.mjs';
2
+ export { A as AlternativeUri, u as ChargeLimitUpdatedRequest, v as ChargeLimitUpdatedResponse, e as ChargeLineItem, k as ChargesRejectedReason, j as ChargesRejectedRequest, l as ChargesRejectedResponse, x as Context, w as CustomChargesConfig, C as Cycle, a as CycleType, b as Duration, D as DurationUnit, G as GetChargeLimitRequest, c as GetChargeLimitResponse, z as IdentificationData, B as IdentificationDataIdOneOf, y as IdentityType, I as Intent, r as InvoiceCreatedRequest, t as InvoiceCreatedResponse, s as InvoiceLineItem, L as ListChargesRequest, d as ListChargesResponse, f as ListUsagesRequest, g as ListUsagesRequestIntent, h as ListUsagesResponse, S as SpiBaseUri, i as Usage, n as UsageLineItem, U as UsagePeriod, o as UsagesRejectedReason, m as UsagesRejectedRequest, q as UsagesRejectedResponse } from './interfaces-premium-v1-custom-charges-provider.public-Dr4u8ZuA.mjs';
3
3
  import { BuildServicePluginDefinition } from '@wix/sdk-types';
4
4
 
5
5
  declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
@@ -1,4 +1,16 @@
1
1
  // src/service-plugins-types.ts
2
+ var DurationUnit = /* @__PURE__ */ ((DurationUnit2) => {
3
+ DurationUnit2["DAY"] = "DAY";
4
+ DurationUnit2["WEEK"] = "WEEK";
5
+ DurationUnit2["MONTH"] = "MONTH";
6
+ DurationUnit2["YEAR"] = "YEAR";
7
+ return DurationUnit2;
8
+ })(DurationUnit || {});
9
+ var CycleType = /* @__PURE__ */ ((CycleType2) => {
10
+ CycleType2["ONE_TIME"] = "ONE_TIME";
11
+ CycleType2["RECURRING"] = "RECURRING";
12
+ return CycleType2;
13
+ })(CycleType || {});
2
14
  var Intent = /* @__PURE__ */ ((Intent2) => {
3
15
  Intent2["DISPLAY_ONLY"] = "DISPLAY_ONLY";
4
16
  Intent2["CREATE_INVOICE"] = "CREATE_INVOICE";
@@ -179,6 +191,8 @@ var provideHandlers2 = createServicePluginModule(
179
191
  );
180
192
  export {
181
193
  ChargesRejectedReason,
194
+ CycleType,
195
+ DurationUnit,
182
196
  IdentityType,
183
197
  Intent,
184
198
  ListUsagesRequestIntent,