@wix/auto_sdk_ecom_memberships 1.0.46 → 1.0.47
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.
- package/build/cjs/index.d.ts +2 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +2 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/{service-plugins-error-classes-Cza9sKXl.d.ts → service-plugins-error-classes-BhKAiJNy.d.ts} +8 -0
- package/build/es/index.d.mts +2 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +2 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/{service-plugins-error-classes-Cza9sKXl.d.mts → service-plugins-error-classes-BhKAiJNy.d.mts} +8 -0
- package/build/internal/cjs/index.d.ts +2 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +2 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/{service-plugins-error-classes-Cza9sKXl.d.ts → service-plugins-error-classes-BhKAiJNy.d.ts} +8 -0
- package/build/internal/es/index.d.mts +2 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +2 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/{service-plugins-error-classes-Cza9sKXl.d.mts → service-plugins-error-classes-BhKAiJNy.d.mts} +8 -0
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as provideHandlers$1 } from './service-plugins-error-classes-
|
|
2
|
-
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference, D as ChargeMembershipRequest, G as ChargeMembershipResponse, Z as Context, R as Ended, E as EnhanceAndValidateSelectionRequest, y as EnhanceAndValidateSelectionResponse, z as ExistingMembershipEnhanced, x as ExistingMembershipInput, A as FutureMembership, F as FutureMembershipInput, U as GetMembershipVoidabilityRequest, V as GetMembershipVoidabilityResponse, $ as IdentificationData, a0 as IdentificationDataIdOneOf, _ as IdentityType, a2 as InsufficientBalanceWixError, I as InvalidMembership, a1 as InvalidSelectionWixError, i as LimitedQuota, j as LimitedQuotaType, a as LineItem, u as LineItemCoverage, o as LineItemNotFoundInfo, L as ListEligibleMembershipsRequest, d as ListEligibleMembershipsResponse, s as ListExistingMembershipsRequest, t as ListExistingMembershipsResponse, v as ListPurchasablePlansRequest, w as ListPurchasablePlansResponse, M as Membership, T as MembershipAlreadyChargedError, a5 as MembershipAlreadyChargedWixError, H as MembershipCannotBeChargedError, J as MembershipCannotBeChargedErrorErrorDataOneOf, K as MembershipCannotBeChargedType, r as MembershipCannotBeUsedForLineItemInfo, q as MembershipCannotBeUsedForLineItemsInfo, a4 as MembershipCannotBeUsedWixError, a3 as MembershipDoesNotApplyToItemWixError, n as MembershipErrorType, l as MembershipInvalidSelectionError, m as MembershipInvalidSelectionErrorErrorDataOneOf, k as MembershipInvalidSelectionErrors, e as MembershipName, f as MembershipPaymentCredits, Y as MembershipsSPIConfig, N as NotStartedYet, O as OutOfCredits, P as PurchasablePlan, Q as QuotaType, c as SelectedMembership, b as SelectedMemberships, S as ServiceProperties, a8 as TransactionAlreadyVoidedWixError, a7 as TransactionCannotBeVoidedWixError, a6 as TransactionNotFoundWixError, W as VoidMembershipChargeRequest, X as VoidMembershipChargeResponse } from './service-plugins-error-classes-
|
|
1
|
+
import { p as provideHandlers$1 } from './service-plugins-error-classes-BhKAiJNy.js';
|
|
2
|
+
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference, D as ChargeMembershipRequest, G as ChargeMembershipResponse, Z as Context, R as Ended, E as EnhanceAndValidateSelectionRequest, y as EnhanceAndValidateSelectionResponse, z as ExistingMembershipEnhanced, x as ExistingMembershipInput, A as FutureMembership, F as FutureMembershipInput, U as GetMembershipVoidabilityRequest, V as GetMembershipVoidabilityResponse, $ as IdentificationData, a0 as IdentificationDataIdOneOf, _ as IdentityType, a2 as InsufficientBalanceWixError, I as InvalidMembership, a1 as InvalidSelectionWixError, i as LimitedQuota, j as LimitedQuotaType, a as LineItem, u as LineItemCoverage, o as LineItemNotFoundInfo, L as ListEligibleMembershipsRequest, d as ListEligibleMembershipsResponse, s as ListExistingMembershipsRequest, t as ListExistingMembershipsResponse, v as ListPurchasablePlansRequest, w as ListPurchasablePlansResponse, M as Membership, T as MembershipAlreadyChargedError, a5 as MembershipAlreadyChargedWixError, H as MembershipCannotBeChargedError, J as MembershipCannotBeChargedErrorErrorDataOneOf, K as MembershipCannotBeChargedType, r as MembershipCannotBeUsedForLineItemInfo, q as MembershipCannotBeUsedForLineItemsInfo, a4 as MembershipCannotBeUsedWixError, a3 as MembershipDoesNotApplyToItemWixError, n as MembershipErrorType, l as MembershipInvalidSelectionError, m as MembershipInvalidSelectionErrorErrorDataOneOf, k as MembershipInvalidSelectionErrors, e as MembershipName, f as MembershipPaymentCredits, Y as MembershipsSPIConfig, N as NotStartedYet, O as OutOfCredits, P as PurchasablePlan, Q as QuotaType, c as SelectedMembership, b as SelectedMemberships, S as ServiceProperties, a8 as TransactionAlreadyVoidedWixError, a7 as TransactionCannotBeVoidedWixError, a6 as TransactionNotFoundWixError, W as VoidMembershipChargeRequest, X as VoidMembershipChargeResponse } from './service-plugins-error-classes-BhKAiJNy.js';
|
|
3
3
|
import { BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-ecom-v1-memberships-provider.public.ts","../../src/interfaces-ecom-v1-memberships-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-ecom-v1-memberships-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","export interface ListEligibleMembershipsRequest {\n /**\n * The line items for which to list eligible memberships.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * The selected payment memberships and which line items they apply to.\n *\n * When not provided, your implementation is expected to return the default selection.\n * When provided, your implementation is expected to validate and return it.\n */\n selectedMemberships?: SelectedMemberships;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Catalog and item reference info. */\n catalogReference?: CatalogReference;\n /** Properties of the service. When relevant, contains information such as date and number of participants. */\n serviceProperties?: ServiceProperties;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n *\n * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface ServiceProperties {\n /**\n * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.\n * For example, the start time of a class.\n */\n scheduledDate?: Date | null;\n /**\n * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.\n * @min 1\n * @max 10000\n */\n numberOfParticipants?: number | null;\n}\n\nexport interface SelectedMemberships {\n /**\n * Selected memberships.\n * @maxSize 300\n */\n memberships?: SelectedMembership[];\n}\n\nexport interface SelectedMembership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * IDs of the line items this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface ListEligibleMembershipsResponse {\n /**\n * List of memberships that are eligible for the given member and line items.\n * @maxSize 300\n */\n eligibleMemberships?: Membership[];\n /**\n * List of memberships owned by the member, but cannot be used due to the reason provided.\n * @maxSize 300\n */\n invalidMemberships?: InvalidMembership[];\n /**\n * List of selected memberships and which line items they apply to.\n * @maxSize 300\n */\n selectedMemberships?: SelectedMembership[];\n}\n\nexport interface Membership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Membership name. */\n name?: MembershipName;\n /**\n * Deprecated. Use the response-level `coverages` (`LineItemCoverage`) to see which line items each benefit covers.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n * @deprecated\n * @replacedBy coverages.line_item_id\n */\n lineItemIds?: string[];\n /**\n * Deprecated. Use `benefits`, which supports memberships with more than one benefit.\n * @deprecated\n * @replacedBy benefits\n */\n credits?: MembershipPaymentCredits;\n /**\n * Membership expiration date.\n * @deprecated\n * @replacedBy offering_description\n */\n expirationDate?: Date | null;\n /**\n * Deprecated. Use `benefits.additional_data` for benefit-specific provider data.\n * @deprecated\n */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface MembershipName {\n /**\n * Membership name.\n * @maxLength 100\n */\n original?: string;\n /**\n * Translated membership name. Defaults to `original` when not provided.\n * @maxLength 100\n */\n translated?: string | null;\n}\n\nexport interface MembershipPaymentCredits {\n /**\n * Membership's initial value.\n * @min 1\n */\n total?: number;\n /** Membership's remaining value. */\n remaining?: number;\n}\n\nexport enum BalanceType {\n /** Balance is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Balance is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\n/**\n * A single redeemable benefit granted by a membership or a purchasable plan.\n * Used by the per-benefit redemption flow (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`).\n */\nexport interface Benefit extends BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n /**\n * Identifier for this benefit. Must be unique within the response so the response-level `coverages`\n * (`LineItemCoverage.benefit_id`) can reference it unambiguously across memberships/plans.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Human-readable label for this benefit (for example, \"Manicure\" or \"Pedicure\" on multi-set punchcards).\n * @maxLength 200\n */\n label?: string | null;\n /**\n * The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),\n * or an unbounded amount that is never drawn down (`UNLIMITED`).\n */\n quotaType?: QuotaType;\n}\n\n/** @oneof */\nexport interface BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n}\n\nexport enum QuotaType {\n /** The benefit grants a countable quota that is drawn down on redemption. */\n LIMITED = 'LIMITED',\n /** The benefit is unlimited (unbounded) and is never drawn down. */\n UNLIMITED = 'UNLIMITED',\n}\n\n/** A limited, countable redeemable amount. */\nexport interface LimitedQuota {\n /**\n * The quota's initial value.\n * @min 1\n */\n total?: number;\n /** The quota's remaining value. */\n remaining?: number;\n /** How the quota is measured. */\n limitedQuotaType?: LimitedQuotaType;\n}\n\nexport enum LimitedQuotaType {\n /** Quota is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Quota is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\nexport interface InvalidMembership {\n /** The membership that is invalid and cannot be used. */\n membership?: Membership;\n /**\n * Reason why this membership is invalid.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string;\n}\n\nexport interface MembershipInvalidSelectionErrors {\n /**\n * Error details for invalid memberships.\n * @maxSize 300\n */\n membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];\n}\n\nexport interface MembershipInvalidSelectionError\n extends MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n /**\n * Membership ID.\n * @format GUID\n */\n membershipId?: string;\n /** Error type. */\n errorType?: MembershipErrorType;\n}\n\n/** @oneof */\nexport interface MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n}\n\nexport enum MembershipErrorType {\n UNKNOWN = 'UNKNOWN',\n /** Membership not found. */\n MEMBERSHIP_NOT_FOUND = 'MEMBERSHIP_NOT_FOUND',\n /** The selection points to a line item ID that wasn't provided. */\n LINE_ITEM_NOT_FOUND = 'LINE_ITEM_NOT_FOUND',\n /** The membership cannot be used for the specific line items provided. */\n MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS = 'MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS',\n /** The membership can be used for each individual line item, but combining all of them is invalid. */\n MEMBERSHIP_SELECTION_INVALID = 'MEMBERSHIP_SELECTION_INVALID',\n}\n\nexport interface LineItemNotFoundInfo {\n /**\n * Line item IDs that were missing.\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemsInfo {\n /**\n * Line items that cannot be used with this membership, and the reason why.\n * @maxSize 300\n */\n lineItems?: MembershipCannotBeUsedForLineItemInfo[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemInfo {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * Reason why this line item cannot be used with this membership.\n * @maxLength 1000\n */\n reason?: string;\n}\n\nexport interface ListExistingMembershipsRequest {\n /**\n * The line items for which to list memberships the member already owns.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n}\n\nexport interface ListExistingMembershipsResponse {\n /**\n * Memberships the member already owns that apply to one or more input line items.\n * @maxSize 300\n */\n existingMemberships?: Membership[];\n /**\n * How the returned benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\n/**\n * Maps a benefit to a line item it can cover, and at what cost. Returned (nested) alongside `benefits`\n * and linked to a benefit by `benefit_id`. One entry per (benefit, line item).\n */\nexport interface LineItemCoverage {\n /**\n * The benefit that covers the line item, as returned in `Benefit.benefit_id`.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * The line item this benefit covers.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the benefit's `limited_quota.remaining` value for this item.\n * Always 0 for an unlimited benefit (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\nexport interface ListPurchasablePlansRequest {\n /**\n * The line items for which to list plans the member could purchase.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n}\n\nexport interface ListPurchasablePlansResponse {\n /**\n * Plans the member could purchase that would cover one or more input line items.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the returned plans' benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface PurchasablePlan {\n /** Catalog and item reference for the plan that can be purchased. */\n catalogReference?: CatalogReference;\n /** Plan name. */\n name?: MembershipName;\n /**\n * Benefits the plan would grant once purchased. Multiple entries support multi-benefit plans (e.g., a bundle granting separate yoga and pilates credits).\n * @minSize 1\n * @maxSize 50\n */\n benefits?: Benefit[];\n /**\n * Human-readable offering summary for display (for example price and validity text). Provider-supplied.\n * @maxLength 500\n */\n offeringDescription?: string | null;\n /**\n * URL the buyer is redirected to in order to collect additional info required to purchase this plan.\n * @format WEB_URL\n */\n infoCollectionUrl?: string | null;\n /**\n * Plan price.\n * @decimalValue options { gte:0, maxScale:3 }\n */\n price?: string;\n}\n\nexport interface EnhanceAndValidateSelectionRequest {\n /**\n * Memberships the caller has selected from the member's existing memberships pool.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipInput[];\n /**\n * Future memberships the caller intends to purchase as part of this checkout.\n * @maxSize 300\n */\n futureMemberships?: FutureMembershipInput[];\n /**\n * Member ID.\n *\n * Required when `existing_memberships` is not empty; omitted for future-memberships-only selections.\n * Optional (StringValue) so an absent member id is sent unset rather than as an empty string, which would fail GUID validation.\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ExistingMembershipInput {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Line items the caller intends to redeem against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembershipInput {\n /** Catalog reference of the plan that will be purchased. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Line items the caller intends to redeem against the future membership.\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface EnhanceAndValidateSelectionResponse {\n /**\n * Validated and enhanced existing membership selections.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipEnhanced[];\n /**\n * Validated and enhanced future membership selections.\n * @maxSize 300\n */\n futureMemberships?: FutureMembership[];\n}\n\nexport interface ExistingMembershipEnhanced {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n /**\n * Validated line items redeemed against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembership {\n /** Catalog reference of the validated future membership. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n}\n\nexport interface ChargeMembershipRequest {\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value is typically `membershipId` + `orderId` + `rootCatalogItemId`.\n * @minLength 1\n * @maxLength 200\n */\n idempotencyKey: string;\n /**\n * Service properties.\n *\n * When relevant, this contains information such as date and number of participants.\n */\n serviceProperties?: ServiceProperties;\n /** Catalog and item reference info. */\n catalogReference: CatalogReference;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n /** Additional data about this charge. */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface ChargeMembershipResponse {\n /**\n * The transaction ID for this charge.\n *\n * Use this ID to void the charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface MembershipCannotBeChargedError\n extends MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n /** Error type. */\n errorType?: MembershipCannotBeChargedType;\n}\n\n/** @oneof */\nexport interface MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n}\n\nexport enum MembershipCannotBeChargedType {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n OUT_OF_CREDITS = 'OUT_OF_CREDITS',\n /** Membership has not become active yet. */\n NOT_STARTED_YET = 'NOT_STARTED_YET',\n /** Membership has expired or ended. */\n ENDED = 'ENDED',\n /** Not applicable for multiple participants. */\n NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS = 'NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS',\n}\n\nexport interface OutOfCredits {\n /** Required amount of credits. */\n required?: number;\n /** Remaining amount of credits. */\n remaining?: number;\n}\n\nexport interface NotStartedYet {\n /** Start date of the membership. */\n membershipStartDate?: Date | null;\n}\n\nexport interface Ended {\n /** End date of the membership. */\n endDate?: Date | null;\n}\n\nexport interface MembershipAlreadyChargedError {\n /**\n * ID of the transaction that was already used for membership charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface GetMembershipVoidabilityRequest {\n /**\n * Transaction ID to check if it can be voided.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface GetMembershipVoidabilityResponse {\n /** Whether the membership charge can be voided. */\n voidable?: boolean;\n /**\n * Reason why the membership charge cannot be voided.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string | null;\n}\n\nexport interface VoidMembershipChargeRequest {\n /**\n * Transaction ID to void.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface VoidMembershipChargeResponse {}\n\nexport interface MembershipsSPIConfig {\n /**\n * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.\n * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.\n * @format WEB_URL\n */\n deploymentUri?: string;\n /**\n * The app IDs of the catalogs your app supports.\n * @minSize 1\n * @maxSize 300\n * @format GUID\n */\n catalogAppDefIds?: string[];\n /**\n * Set to true once your app implements the updated redemption methods (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`)\n * and the per-balance redemption model. While false, Wix eCommerce keeps calling the legacy `ListEligibleMemberships` flow.\n * This toggle lets providers migrate without a synchronized deploy and is removed once migration completes.\n */\n toggleUpdatedMethodsEnabled?: boolean;\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 ListEligibleMembershipsRequest,\n ListEligibleMembershipsResponse,\n ChargeMembershipRequest,\n ChargeMembershipResponse,\n GetMembershipVoidabilityRequest,\n GetMembershipVoidabilityResponse,\n VoidMembershipChargeRequest,\n VoidMembershipChargeResponse,\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 ListEligibleMembershipsEnvelope {\n request: ListEligibleMembershipsRequest;\n metadata: Context;\n}\n\nexport interface ChargeMembershipEnvelope {\n request: ChargeMembershipRequest;\n metadata: Context;\n}\n\nexport interface GetMembershipVoidabilityEnvelope {\n request: GetMembershipVoidabilityRequest;\n metadata: Context;\n}\n\nexport interface VoidMembershipChargeEnvelope {\n request: VoidMembershipChargeRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Deprecated. Use `ListExistingMemberships` + `ListPurchasablePlans` for read, and `EnhanceAndValidateSelection` for selection validation. */\n listEligibleMemberships(\n payload: ListEligibleMembershipsEnvelope\n ): ListEligibleMembershipsResponse | Promise<ListEligibleMembershipsResponse>;\n\n /**\n *\n * This method requests that a membership be charged by your app. */\n chargeMembership(\n payload: ChargeMembershipEnvelope\n ): ChargeMembershipResponse | Promise<ChargeMembershipResponse>;\n\n /**\n *\n * This method retrieves from your app whether a membership can be voided. */\n getMembershipVoidability(\n payload: GetMembershipVoidabilityEnvelope\n ):\n | GetMembershipVoidabilityResponse\n | Promise<GetMembershipVoidabilityResponse>;\n\n /**\n *\n * This method requests that a membership charge be voided by your app. */\n voidMembershipCharge(\n payload: VoidMembershipChargeEnvelope\n ): VoidMembershipChargeResponse | Promise<VoidMembershipChargeResponse>;\n}>('ECOM_MEMBERSHIPS', [\n {\n name: 'listEligibleMemberships',\n primaryHttpMappingPath: '/v1/list-eligible-memberships',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'eligibleMemberships.expirationDate' },\n { path: 'invalidMemberships.membership.expirationDate' },\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.lineItems.serviceProperties.scheduledDate' },\n { path: 'request.lineItems.serviceProperties.endDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'chargeMembership',\n primaryHttpMappingPath: '/v1/charge-membership',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.serviceProperties.scheduledDate' },\n { path: 'request.serviceProperties.endDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'getMembershipVoidability',\n primaryHttpMappingPath: '/v1/get-voidability',\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: 'voidMembershipCharge',\n primaryHttpMappingPath: '/v1/void-membership-charge',\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-ecom-v1-memberships-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-ecom-v1-memberships-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","import {\n MembershipInvalidSelectionErrors,\n MembershipCannotBeChargedError,\n MembershipAlreadyChargedError,\n} from './service-plugins-types.js';\n\n/**\n * The provided membership selection is invalid\n */\nexport class InvalidSelectionWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipInvalidSelectionErrors;\n\n constructor(data: MembershipInvalidSelectionErrors = {}) {\n super('InvalidSelection');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_SELECTION';\n this.name = 'InvalidSelection';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipInvalidSelectionErrors';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidSelection',\n applicationCode: 'INVALID_SELECTION',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The selected memberships do not have enough balance to cover the line items.\n */\nexport class InsufficientBalanceWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InsufficientBalance');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'INSUFFICIENT_BALANCE';\n this.name = 'InsufficientBalance';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InsufficientBalance',\n applicationCode: 'INSUFFICIENT_BALANCE',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, but does not apply for the provided item\n */\nexport class MembershipDoesNotApplyToItemWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MembershipDoesNotApplyToItem');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM';\n this.name = 'MembershipDoesNotApplyToItem';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipDoesNotApplyToItem',\n applicationCode: 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, applied to the provided item but cannot be charged. For example because a limited membership doesn't have enough credits\n */\nexport class MembershipCannotBeUsedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipCannotBeChargedError;\n\n constructor(data: MembershipCannotBeChargedError = {}) {\n super('MembershipCannotBeUsed');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MEMBERSHIP_CANNOT_BE_CHARGED';\n this.name = 'MembershipCannotBeUsed';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipCannotBeChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipCannotBeUsed',\n applicationCode: 'MEMBERSHIP_CANNOT_BE_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * This charge was already done, per the idempotency key of membershipId + orderId + rootCatalogItemId\n */\nexport class MembershipAlreadyChargedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipAlreadyChargedError;\n\n constructor(data: MembershipAlreadyChargedError = {}) {\n super('MembershipAlreadyCharged');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'MEMBERSHIP_ALREADY_CHARGED';\n this.name = 'MembershipAlreadyCharged';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipAlreadyChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipAlreadyCharged',\n applicationCode: 'MEMBERSHIP_ALREADY_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction not found\n */\nexport class TransactionNotFoundWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionNotFound');\n\n this.httpCode = 404;\n this.statusCode = 'NOT_FOUND';\n this.applicationCode = 'TRANSACTION_NOT_FOUND';\n this.name = 'TransactionNotFound';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionNotFound',\n applicationCode: 'TRANSACTION_NOT_FOUND',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction exists but cannot be voided\n */\nexport class TransactionCannotBeVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionCannotBeVoided');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'TRANSACTION_CANNOT_BE_VOIDED';\n this.name = 'TransactionCannotBeVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionCannotBeVoided',\n applicationCode: 'TRANSACTION_CANNOT_BE_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction was already voided\n */\nexport class TransactionAlreadyVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionAlreadyVoided');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'TRANSACTION_ALREADY_VOIDED';\n this.name = 'TransactionAlreadyVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionAlreadyVoided',\n applicationCode: 'TRANSACTION_ALREADY_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACmMO,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,gBAAa;AAEb,EAAAA,aAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AAqCL,IAAK,YAAL,kBAAKC,eAAL;AAEL,EAAAA,WAAA,aAAU;AAEV,EAAAA,WAAA,eAAY;AAJF,SAAAA;AAAA,GAAA;AAoBL,IAAK,mBAAL,kBAAKC,sBAAL;AAEL,EAAAA,kBAAA,gBAAa;AAEb,E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G;AACpD,UAAM,0BAA0B;AAEhC,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,kBACH;AACF,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAEA,SAAK,OAAO;AAAA,EACd;AAIF;AAAA;AAtCa,iCAqCK,SAAS;AAMpB,IAAM,8BAAN,cAA0C,MAAM;AAAA,EAcrD,cAAc;AACZ,UAAM,qBAAqB;AAE3B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,4BA6BK,SAAS;AAMpB,IAAM,oCAAN,cAAgD,MAAM;AAAA,EAc3D,cAAc;AACZ,UAAM,2BAA2B;AAEjC,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,kCA6BK,SAAS;AAMpB,IAAM,mCAAN,cAA+C,MAAM;AAAA,EAc1D,cAAc;AACZ,UAAM,0BAA0B;AAEhC,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,iCA6BK,SAAS;","names":["provideHandlers","BalanceType","QuotaType","LimitedQuotaType","MembershipErrorType","MembershipCannotBeChargedType","IdentityType","import_timestamp","provideHandlers"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-ecom-v1-memberships-provider.public.ts","../../src/interfaces-ecom-v1-memberships-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-ecom-v1-memberships-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","export interface ListEligibleMembershipsRequest {\n /**\n * The line items for which to list eligible memberships.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * The selected payment memberships and which line items they apply to.\n *\n * When not provided, your implementation is expected to return the default selection.\n * When provided, your implementation is expected to validate and return it.\n */\n selectedMemberships?: SelectedMemberships;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Catalog and item reference info. */\n catalogReference?: CatalogReference;\n /** Properties of the service. When relevant, contains information such as date and number of participants. */\n serviceProperties?: ServiceProperties;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n *\n * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface ServiceProperties {\n /**\n * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.\n * For example, the start time of a class.\n */\n scheduledDate?: Date | null;\n /**\n * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.\n * @min 1\n * @max 10000\n */\n numberOfParticipants?: number | null;\n}\n\nexport interface SelectedMemberships {\n /**\n * Selected memberships.\n * @maxSize 300\n */\n memberships?: SelectedMembership[];\n}\n\nexport interface SelectedMembership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * IDs of the line items this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface ListEligibleMembershipsResponse {\n /**\n * List of memberships that are eligible for the given member and line items.\n * @maxSize 300\n */\n eligibleMemberships?: Membership[];\n /**\n * List of memberships owned by the member, but cannot be used due to the reason provided.\n * @maxSize 300\n */\n invalidMemberships?: InvalidMembership[];\n /**\n * List of selected memberships and which line items they apply to.\n * @maxSize 300\n */\n selectedMemberships?: SelectedMembership[];\n}\n\nexport interface Membership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Membership name. */\n name?: MembershipName;\n /**\n * Deprecated. Use the response-level `coverages` (`LineItemCoverage`) to see which line items each benefit covers.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n * @deprecated\n * @replacedBy coverages.line_item_id\n */\n lineItemIds?: string[];\n /**\n * Deprecated. Use `benefits`, which supports memberships with more than one benefit.\n * @deprecated\n * @replacedBy benefits\n */\n credits?: MembershipPaymentCredits;\n /**\n * Membership expiration date.\n * @deprecated\n * @replacedBy offering_description\n */\n expirationDate?: Date | null;\n /**\n * Deprecated. Use `benefits.additional_data` for benefit-specific provider data.\n * @deprecated\n */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface MembershipName {\n /**\n * Membership name.\n * @maxLength 100\n */\n original?: string;\n /**\n * Translated membership name. Defaults to `original` when not provided.\n * @maxLength 100\n */\n translated?: string | null;\n}\n\nexport interface MembershipPaymentCredits {\n /**\n * Membership's initial value.\n * @min 1\n */\n total?: number;\n /** Membership's remaining value. */\n remaining?: number;\n}\n\nexport enum BalanceType {\n /** Balance is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Balance is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\n/**\n * A single redeemable benefit granted by a membership or a purchasable plan.\n * Used by the per-benefit redemption flow (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`).\n */\nexport interface Benefit extends BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n /**\n * Identifier for this benefit. Must be unique within the response so the response-level `coverages`\n * (`LineItemCoverage.benefit_id`) can reference it unambiguously across memberships/plans.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Human-readable label for this benefit (for example, \"Manicure\" or \"Pedicure\" on multi-set punchcards).\n * @maxLength 200\n */\n label?: string | null;\n /**\n * The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),\n * or an unbounded amount that is never drawn down (`UNLIMITED`).\n */\n quotaType?: QuotaType;\n}\n\n/** @oneof */\nexport interface BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n}\n\nexport enum QuotaType {\n /** The benefit grants a countable quota that is drawn down on redemption. */\n LIMITED = 'LIMITED',\n /** The benefit is unlimited (unbounded) and is never drawn down. */\n UNLIMITED = 'UNLIMITED',\n}\n\n/** A limited, countable redeemable amount. */\nexport interface LimitedQuota {\n /**\n * The quota's initial value.\n * @min 1\n */\n total?: number;\n /** The quota's remaining value. */\n remaining?: number;\n /** How the quota is measured. */\n limitedQuotaType?: LimitedQuotaType;\n}\n\nexport enum LimitedQuotaType {\n /** Quota is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Quota is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\nexport interface InvalidMembership {\n /** The membership that is invalid and cannot be used. */\n membership?: Membership;\n /**\n * Reason why this membership is invalid.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string;\n}\n\nexport interface MembershipInvalidSelectionErrors {\n /**\n * Error details for invalid memberships.\n * @maxSize 300\n */\n membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];\n}\n\nexport interface MembershipInvalidSelectionError\n extends MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n /**\n * Membership ID.\n * @format GUID\n */\n membershipId?: string;\n /** Error type. */\n errorType?: MembershipErrorType;\n}\n\n/** @oneof */\nexport interface MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n}\n\nexport enum MembershipErrorType {\n UNKNOWN = 'UNKNOWN',\n /** Membership not found. */\n MEMBERSHIP_NOT_FOUND = 'MEMBERSHIP_NOT_FOUND',\n /** The selection points to a line item ID that wasn't provided. */\n LINE_ITEM_NOT_FOUND = 'LINE_ITEM_NOT_FOUND',\n /** The membership cannot be used for the specific line items provided. */\n MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS = 'MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS',\n /** The membership can be used for each individual line item, but combining all of them is invalid. */\n MEMBERSHIP_SELECTION_INVALID = 'MEMBERSHIP_SELECTION_INVALID',\n}\n\nexport interface LineItemNotFoundInfo {\n /**\n * Line item IDs that were missing.\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemsInfo {\n /**\n * Line items that cannot be used with this membership, and the reason why.\n * @maxSize 300\n */\n lineItems?: MembershipCannotBeUsedForLineItemInfo[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemInfo {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * Reason why this line item cannot be used with this membership.\n * @maxLength 1000\n */\n reason?: string;\n}\n\nexport interface ListExistingMembershipsRequest {\n /**\n * The line items for which to list memberships the member already owns.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n}\n\nexport interface ListExistingMembershipsResponse {\n /**\n * Memberships the member already owns that apply to one or more input line items.\n * @maxSize 300\n */\n existingMemberships?: Membership[];\n /**\n * How the returned benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\n/**\n * Maps a benefit to a line item it can cover, and at what cost. Returned (nested) alongside `benefits`\n * and linked to a benefit by `benefit_id`. One entry per (benefit, line item).\n */\nexport interface LineItemCoverage {\n /**\n * The benefit that covers the line item, as returned in `Benefit.benefit_id`.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * The line item this benefit covers.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the benefit's `limited_quota.remaining` value for this item.\n * Always 0 for an unlimited benefit (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\nexport interface ListPurchasablePlansRequest {\n /**\n * The line items for which to list plans the member could purchase.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n}\n\nexport interface ListPurchasablePlansResponse {\n /**\n * Plans the member could purchase that would cover one or more input line items.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the returned plans' benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface PurchasablePlan {\n /** Catalog and item reference for the plan that can be purchased. */\n catalogReference?: CatalogReference;\n /** Plan name. */\n name?: MembershipName;\n /**\n * Benefits the plan would grant once purchased. Multiple entries support multi-benefit plans (e.g., a bundle granting separate yoga and pilates credits).\n * @minSize 1\n * @maxSize 50\n */\n benefits?: Benefit[];\n /**\n * Human-readable offering summary for display (for example price and validity text). Provider-supplied.\n * @maxLength 500\n */\n offeringDescription?: string | null;\n /**\n * URL the buyer is redirected to in order to collect additional info required to purchase this plan.\n * @format WEB_URL\n */\n infoCollectionUrl?: string | null;\n /**\n * Plan price.\n * @decimalValue options { gte:0, maxScale:3 }\n */\n price?: string;\n /**\n * Human-readable description of the plan price (for example \"First month free, then $20/month\").\n *\n * `price` is simply the price (useful for sorting or comparison, for example), while this is a\n * descriptive, display-oriented summary of it.\n * @maxLength 500\n */\n priceDescription?: string | null;\n}\n\nexport interface EnhanceAndValidateSelectionRequest {\n /**\n * Memberships the caller has selected from the member's existing memberships pool.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipInput[];\n /**\n * Future memberships the caller intends to purchase as part of this checkout.\n * @maxSize 300\n */\n futureMemberships?: FutureMembershipInput[];\n /**\n * Member ID.\n *\n * Required when `existing_memberships` is not empty; omitted for future-memberships-only selections.\n * Optional (StringValue) so an absent member id is sent unset rather than as an empty string, which would fail GUID validation.\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ExistingMembershipInput {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Line items the caller intends to redeem against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembershipInput {\n /** Catalog reference of the plan that will be purchased. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Line items the caller intends to redeem against the future membership.\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface EnhanceAndValidateSelectionResponse {\n /**\n * Validated and enhanced existing membership selections.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipEnhanced[];\n /**\n * Validated and enhanced future membership selections.\n * @maxSize 300\n */\n futureMemberships?: FutureMembership[];\n}\n\nexport interface ExistingMembershipEnhanced {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n /**\n * Validated line items redeemed against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembership {\n /** Catalog reference of the validated future membership. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n}\n\nexport interface ChargeMembershipRequest {\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value is typically `membershipId` + `orderId` + `rootCatalogItemId`.\n * @minLength 1\n * @maxLength 200\n */\n idempotencyKey: string;\n /**\n * Service properties.\n *\n * When relevant, this contains information such as date and number of participants.\n */\n serviceProperties?: ServiceProperties;\n /** Catalog and item reference info. */\n catalogReference: CatalogReference;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n /** Additional data about this charge. */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface ChargeMembershipResponse {\n /**\n * The transaction ID for this charge.\n *\n * Use this ID to void the charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface MembershipCannotBeChargedError\n extends MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n /** Error type. */\n errorType?: MembershipCannotBeChargedType;\n}\n\n/** @oneof */\nexport interface MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n}\n\nexport enum MembershipCannotBeChargedType {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n OUT_OF_CREDITS = 'OUT_OF_CREDITS',\n /** Membership has not become active yet. */\n NOT_STARTED_YET = 'NOT_STARTED_YET',\n /** Membership has expired or ended. */\n ENDED = 'ENDED',\n /** Not applicable for multiple participants. */\n NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS = 'NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS',\n}\n\nexport interface OutOfCredits {\n /** Required amount of credits. */\n required?: number;\n /** Remaining amount of credits. */\n remaining?: number;\n}\n\nexport interface NotStartedYet {\n /** Start date of the membership. */\n membershipStartDate?: Date | null;\n}\n\nexport interface Ended {\n /** End date of the membership. */\n endDate?: Date | null;\n}\n\nexport interface MembershipAlreadyChargedError {\n /**\n * ID of the transaction that was already used for membership charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface GetMembershipVoidabilityRequest {\n /**\n * Transaction ID to check if it can be voided.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface GetMembershipVoidabilityResponse {\n /** Whether the membership charge can be voided. */\n voidable?: boolean;\n /**\n * Reason why the membership charge cannot be voided.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string | null;\n}\n\nexport interface VoidMembershipChargeRequest {\n /**\n * Transaction ID to void.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface VoidMembershipChargeResponse {}\n\nexport interface MembershipsSPIConfig {\n /**\n * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.\n * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.\n * @format WEB_URL\n */\n deploymentUri?: string;\n /**\n * The app IDs of the catalogs your app supports.\n * @minSize 1\n * @maxSize 300\n * @format GUID\n */\n catalogAppDefIds?: string[];\n /**\n * Set to true once your app implements the updated redemption methods (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`)\n * and the per-balance redemption model. While false, Wix eCommerce keeps calling the legacy `ListEligibleMemberships` flow.\n * This toggle lets providers migrate without a synchronized deploy and is removed once migration completes.\n */\n toggleUpdatedMethodsEnabled?: boolean;\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 ListEligibleMembershipsRequest,\n ListEligibleMembershipsResponse,\n ChargeMembershipRequest,\n ChargeMembershipResponse,\n GetMembershipVoidabilityRequest,\n GetMembershipVoidabilityResponse,\n VoidMembershipChargeRequest,\n VoidMembershipChargeResponse,\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 ListEligibleMembershipsEnvelope {\n request: ListEligibleMembershipsRequest;\n metadata: Context;\n}\n\nexport interface ChargeMembershipEnvelope {\n request: ChargeMembershipRequest;\n metadata: Context;\n}\n\nexport interface GetMembershipVoidabilityEnvelope {\n request: GetMembershipVoidabilityRequest;\n metadata: Context;\n}\n\nexport interface VoidMembershipChargeEnvelope {\n request: VoidMembershipChargeRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Deprecated. Use `ListExistingMemberships` + `ListPurchasablePlans` for read, and `EnhanceAndValidateSelection` for selection validation. */\n listEligibleMemberships(\n payload: ListEligibleMembershipsEnvelope\n ): ListEligibleMembershipsResponse | Promise<ListEligibleMembershipsResponse>;\n\n /**\n *\n * This method requests that a membership be charged by your app. */\n chargeMembership(\n payload: ChargeMembershipEnvelope\n ): ChargeMembershipResponse | Promise<ChargeMembershipResponse>;\n\n /**\n *\n * This method retrieves from your app whether a membership can be voided. */\n getMembershipVoidability(\n payload: GetMembershipVoidabilityEnvelope\n ):\n | GetMembershipVoidabilityResponse\n | Promise<GetMembershipVoidabilityResponse>;\n\n /**\n *\n * This method requests that a membership charge be voided by your app. */\n voidMembershipCharge(\n payload: VoidMembershipChargeEnvelope\n ): VoidMembershipChargeResponse | Promise<VoidMembershipChargeResponse>;\n}>('ECOM_MEMBERSHIPS', [\n {\n name: 'listEligibleMemberships',\n primaryHttpMappingPath: '/v1/list-eligible-memberships',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'eligibleMemberships.expirationDate' },\n { path: 'invalidMemberships.membership.expirationDate' },\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.lineItems.serviceProperties.scheduledDate' },\n { path: 'request.lineItems.serviceProperties.endDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'chargeMembership',\n primaryHttpMappingPath: '/v1/charge-membership',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.serviceProperties.scheduledDate' },\n { path: 'request.serviceProperties.endDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'getMembershipVoidability',\n primaryHttpMappingPath: '/v1/get-voidability',\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: 'voidMembershipCharge',\n primaryHttpMappingPath: '/v1/void-membership-charge',\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-ecom-v1-memberships-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-ecom-v1-memberships-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","import {\n MembershipInvalidSelectionErrors,\n MembershipCannotBeChargedError,\n MembershipAlreadyChargedError,\n} from './service-plugins-types.js';\n\n/**\n * The provided membership selection is invalid\n */\nexport class InvalidSelectionWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipInvalidSelectionErrors;\n\n constructor(data: MembershipInvalidSelectionErrors = {}) {\n super('InvalidSelection');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_SELECTION';\n this.name = 'InvalidSelection';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipInvalidSelectionErrors';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidSelection',\n applicationCode: 'INVALID_SELECTION',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The selected memberships do not have enough balance to cover the line items.\n */\nexport class InsufficientBalanceWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InsufficientBalance');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'INSUFFICIENT_BALANCE';\n this.name = 'InsufficientBalance';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InsufficientBalance',\n applicationCode: 'INSUFFICIENT_BALANCE',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, but does not apply for the provided item\n */\nexport class MembershipDoesNotApplyToItemWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MembershipDoesNotApplyToItem');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM';\n this.name = 'MembershipDoesNotApplyToItem';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipDoesNotApplyToItem',\n applicationCode: 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, applied to the provided item but cannot be charged. For example because a limited membership doesn't have enough credits\n */\nexport class MembershipCannotBeUsedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipCannotBeChargedError;\n\n constructor(data: MembershipCannotBeChargedError = {}) {\n super('MembershipCannotBeUsed');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MEMBERSHIP_CANNOT_BE_CHARGED';\n this.name = 'MembershipCannotBeUsed';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipCannotBeChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipCannotBeUsed',\n applicationCode: 'MEMBERSHIP_CANNOT_BE_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * This charge was already done, per the idempotency key of membershipId + orderId + rootCatalogItemId\n */\nexport class MembershipAlreadyChargedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipAlreadyChargedError;\n\n constructor(data: MembershipAlreadyChargedError = {}) {\n super('MembershipAlreadyCharged');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'MEMBERSHIP_ALREADY_CHARGED';\n this.name = 'MembershipAlreadyCharged';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipAlreadyChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipAlreadyCharged',\n applicationCode: 'MEMBERSHIP_ALREADY_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction not found\n */\nexport class TransactionNotFoundWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionNotFound');\n\n this.httpCode = 404;\n this.statusCode = 'NOT_FOUND';\n this.applicationCode = 'TRANSACTION_NOT_FOUND';\n this.name = 'TransactionNotFound';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionNotFound',\n applicationCode: 'TRANSACTION_NOT_FOUND',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction exists but cannot be voided\n */\nexport class TransactionCannotBeVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionCannotBeVoided');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'TRANSACTION_CANNOT_BE_VOIDED';\n this.name = 'TransactionCannotBeVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionCannotBeVoided',\n applicationCode: 'TRANSACTION_CANNOT_BE_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction was already voided\n */\nexport class TransactionAlreadyVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionAlreadyVoided');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'TRANSACTION_ALREADY_VOIDED';\n this.name = 'TransactionAlreadyVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionAlreadyVoided',\n applicationCode: 'TRANSACTION_ALREADY_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,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,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,iCA6BK,SAAS;","names":["provideHandlers","BalanceType","QuotaType","LimitedQuotaType","MembershipErrorType","MembershipCannotBeChargedType","IdentityType","import_timestamp","provideHandlers"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a9 as ListEligibleMembershipsEnvelope, d as ListEligibleMembershipsResponse, aa as ChargeMembershipEnvelope, G as ChargeMembershipResponse, ab as GetMembershipVoidabilityEnvelope, V as GetMembershipVoidabilityResponse, ac as VoidMembershipChargeEnvelope, X as VoidMembershipChargeResponse } from './service-plugins-error-classes-
|
|
2
|
-
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference, D as ChargeMembershipRequest, Z as Context, R as Ended, E as EnhanceAndValidateSelectionRequest, y as EnhanceAndValidateSelectionResponse, z as ExistingMembershipEnhanced, x as ExistingMembershipInput, A as FutureMembership, F as FutureMembershipInput, U as GetMembershipVoidabilityRequest, $ as IdentificationData, a0 as IdentificationDataIdOneOf, _ as IdentityType, a2 as InsufficientBalanceWixError, I as InvalidMembership, a1 as InvalidSelectionWixError, i as LimitedQuota, j as LimitedQuotaType, a as LineItem, u as LineItemCoverage, o as LineItemNotFoundInfo, L as ListEligibleMembershipsRequest, s as ListExistingMembershipsRequest, t as ListExistingMembershipsResponse, v as ListPurchasablePlansRequest, w as ListPurchasablePlansResponse, M as Membership, T as MembershipAlreadyChargedError, a5 as MembershipAlreadyChargedWixError, H as MembershipCannotBeChargedError, J as MembershipCannotBeChargedErrorErrorDataOneOf, K as MembershipCannotBeChargedType, r as MembershipCannotBeUsedForLineItemInfo, q as MembershipCannotBeUsedForLineItemsInfo, a4 as MembershipCannotBeUsedWixError, a3 as MembershipDoesNotApplyToItemWixError, n as MembershipErrorType, l as MembershipInvalidSelectionError, m as MembershipInvalidSelectionErrorErrorDataOneOf, k as MembershipInvalidSelectionErrors, e as MembershipName, f as MembershipPaymentCredits, Y as MembershipsSPIConfig, N as NotStartedYet, O as OutOfCredits, P as PurchasablePlan, Q as QuotaType, c as SelectedMembership, b as SelectedMemberships, S as ServiceProperties, a8 as TransactionAlreadyVoidedWixError, a7 as TransactionCannotBeVoidedWixError, a6 as TransactionNotFoundWixError, W as VoidMembershipChargeRequest } from './service-plugins-error-classes-
|
|
1
|
+
import { a9 as ListEligibleMembershipsEnvelope, d as ListEligibleMembershipsResponse, aa as ChargeMembershipEnvelope, G as ChargeMembershipResponse, ab as GetMembershipVoidabilityEnvelope, V as GetMembershipVoidabilityResponse, ac as VoidMembershipChargeEnvelope, X as VoidMembershipChargeResponse } from './service-plugins-error-classes-BhKAiJNy.js';
|
|
2
|
+
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference, D as ChargeMembershipRequest, Z as Context, R as Ended, E as EnhanceAndValidateSelectionRequest, y as EnhanceAndValidateSelectionResponse, z as ExistingMembershipEnhanced, x as ExistingMembershipInput, A as FutureMembership, F as FutureMembershipInput, U as GetMembershipVoidabilityRequest, $ as IdentificationData, a0 as IdentificationDataIdOneOf, _ as IdentityType, a2 as InsufficientBalanceWixError, I as InvalidMembership, a1 as InvalidSelectionWixError, i as LimitedQuota, j as LimitedQuotaType, a as LineItem, u as LineItemCoverage, o as LineItemNotFoundInfo, L as ListEligibleMembershipsRequest, s as ListExistingMembershipsRequest, t as ListExistingMembershipsResponse, v as ListPurchasablePlansRequest, w as ListPurchasablePlansResponse, M as Membership, T as MembershipAlreadyChargedError, a5 as MembershipAlreadyChargedWixError, H as MembershipCannotBeChargedError, J as MembershipCannotBeChargedErrorErrorDataOneOf, K as MembershipCannotBeChargedType, r as MembershipCannotBeUsedForLineItemInfo, q as MembershipCannotBeUsedForLineItemsInfo, a4 as MembershipCannotBeUsedWixError, a3 as MembershipDoesNotApplyToItemWixError, n as MembershipErrorType, l as MembershipInvalidSelectionError, m as MembershipInvalidSelectionErrorErrorDataOneOf, k as MembershipInvalidSelectionErrors, e as MembershipName, f as MembershipPaymentCredits, Y as MembershipsSPIConfig, N as NotStartedYet, O as OutOfCredits, P as PurchasablePlan, Q as QuotaType, c as SelectedMembership, b as SelectedMemberships, S as ServiceProperties, a8 as TransactionAlreadyVoidedWixError, a7 as TransactionCannotBeVoidedWixError, a6 as TransactionNotFoundWixError, W as VoidMembershipChargeRequest } from './service-plugins-error-classes-BhKAiJNy.js';
|
|
3
3
|
import '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import {\n ListEligibleMembershipsResponse,\n ChargeMembershipResponse,\n GetMembershipVoidabilityResponse,\n VoidMembershipChargeResponse,\n} from './src/service-plugins-types.js';\nimport {\n ListEligibleMembershipsEnvelope,\n ChargeMembershipEnvelope,\n GetMembershipVoidabilityEnvelope,\n VoidMembershipChargeEnvelope,\n} from './src/interfaces-ecom-v1-memberships-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport {\n ListEligibleMembershipsEnvelope,\n ChargeMembershipEnvelope,\n GetMembershipVoidabilityEnvelope,\n VoidMembershipChargeEnvelope,\n};\n\n/**\n * Deprecated. Use `ListExistingMemberships` + `ListPurchasablePlans` for read, and `EnhanceAndValidateSelection` for selection validation.\n * @throws InvalidSelectionWixError\n * @throws InsufficientBalanceWixError\n */\nexport declare function listEligibleMemberships(\n payload: ListEligibleMembershipsEnvelope\n): ListEligibleMembershipsResponse | Promise<ListEligibleMembershipsResponse>;\n/**\n * This method requests that a membership be charged by your app.\n * @throws MembershipDoesNotApplyToItemWixError\n * @throws MembershipCannotBeUsedWixError\n * @throws MembershipAlreadyChargedWixError\n */\nexport declare function chargeMembership(\n payload: ChargeMembershipEnvelope\n): ChargeMembershipResponse | Promise<ChargeMembershipResponse>;\n/**\n * This method retrieves from your app whether a membership can be voided.\n * @throws TransactionNotFoundWixError\n */\nexport declare function getMembershipVoidability(\n payload: GetMembershipVoidabilityEnvelope\n): GetMembershipVoidabilityResponse | Promise<GetMembershipVoidabilityResponse>;\n/**\n * This method requests that a membership charge be voided by your app.\n * @throws TransactionNotFoundWixError\n * @throws TransactionCannotBeVoidedWixError\n * @throws TransactionAlreadyVoidedWixError\n */\nexport declare function voidMembershipCharge(\n payload: VoidMembershipChargeEnvelope\n): VoidMembershipChargeResponse | Promise<VoidMembershipChargeResponse>;\n","import {\n MembershipInvalidSelectionErrors,\n MembershipCannotBeChargedError,\n MembershipAlreadyChargedError,\n} from './service-plugins-types.js';\n\n/**\n * The provided membership selection is invalid\n */\nexport class InvalidSelectionWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipInvalidSelectionErrors;\n\n constructor(data: MembershipInvalidSelectionErrors = {}) {\n super('InvalidSelection');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_SELECTION';\n this.name = 'InvalidSelection';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipInvalidSelectionErrors';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidSelection',\n applicationCode: 'INVALID_SELECTION',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The selected memberships do not have enough balance to cover the line items.\n */\nexport class InsufficientBalanceWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InsufficientBalance');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'INSUFFICIENT_BALANCE';\n this.name = 'InsufficientBalance';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InsufficientBalance',\n applicationCode: 'INSUFFICIENT_BALANCE',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, but does not apply for the provided item\n */\nexport class MembershipDoesNotApplyToItemWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MembershipDoesNotApplyToItem');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM';\n this.name = 'MembershipDoesNotApplyToItem';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipDoesNotApplyToItem',\n applicationCode: 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, applied to the provided item but cannot be charged. For example because a limited membership doesn't have enough credits\n */\nexport class MembershipCannotBeUsedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipCannotBeChargedError;\n\n constructor(data: MembershipCannotBeChargedError = {}) {\n super('MembershipCannotBeUsed');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MEMBERSHIP_CANNOT_BE_CHARGED';\n this.name = 'MembershipCannotBeUsed';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipCannotBeChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipCannotBeUsed',\n applicationCode: 'MEMBERSHIP_CANNOT_BE_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * This charge was already done, per the idempotency key of membershipId + orderId + rootCatalogItemId\n */\nexport class MembershipAlreadyChargedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipAlreadyChargedError;\n\n constructor(data: MembershipAlreadyChargedError = {}) {\n super('MembershipAlreadyCharged');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'MEMBERSHIP_ALREADY_CHARGED';\n this.name = 'MembershipAlreadyCharged';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipAlreadyChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipAlreadyCharged',\n applicationCode: 'MEMBERSHIP_ALREADY_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction not found\n */\nexport class TransactionNotFoundWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionNotFound');\n\n this.httpCode = 404;\n this.statusCode = 'NOT_FOUND';\n this.applicationCode = 'TRANSACTION_NOT_FOUND';\n this.name = 'TransactionNotFound';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionNotFound',\n applicationCode: 'TRANSACTION_NOT_FOUND',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction exists but cannot be voided\n */\nexport class TransactionCannotBeVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionCannotBeVoided');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'TRANSACTION_CANNOT_BE_VOIDED';\n this.name = 'TransactionCannotBeVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionCannotBeVoided',\n applicationCode: 'TRANSACTION_CANNOT_BE_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction was already voided\n */\nexport class TransactionAlreadyVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionAlreadyVoided');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'TRANSACTION_ALREADY_VOIDED';\n this.name = 'TransactionAlreadyVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionAlreadyVoided',\n applicationCode: 'TRANSACTION_ALREADY_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","export interface ListEligibleMembershipsRequest {\n /**\n * The line items for which to list eligible memberships.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * The selected payment memberships and which line items they apply to.\n *\n * When not provided, your implementation is expected to return the default selection.\n * When provided, your implementation is expected to validate and return it.\n */\n selectedMemberships?: SelectedMemberships;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Catalog and item reference info. */\n catalogReference?: CatalogReference;\n /** Properties of the service. When relevant, contains information such as date and number of participants. */\n serviceProperties?: ServiceProperties;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n *\n * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface ServiceProperties {\n /**\n * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.\n * For example, the start time of a class.\n */\n scheduledDate?: Date | null;\n /**\n * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.\n * @min 1\n * @max 10000\n */\n numberOfParticipants?: number | null;\n}\n\nexport interface SelectedMemberships {\n /**\n * Selected memberships.\n * @maxSize 300\n */\n memberships?: SelectedMembership[];\n}\n\nexport interface SelectedMembership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * IDs of the line items this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface ListEligibleMembershipsResponse {\n /**\n * List of memberships that are eligible for the given member and line items.\n * @maxSize 300\n */\n eligibleMemberships?: Membership[];\n /**\n * List of memberships owned by the member, but cannot be used due to the reason provided.\n * @maxSize 300\n */\n invalidMemberships?: InvalidMembership[];\n /**\n * List of selected memberships and which line items they apply to.\n * @maxSize 300\n */\n selectedMemberships?: SelectedMembership[];\n}\n\nexport interface Membership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Membership name. */\n name?: MembershipName;\n /**\n * Deprecated. Use the response-level `coverages` (`LineItemCoverage`) to see which line items each benefit covers.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n * @deprecated\n * @replacedBy coverages.line_item_id\n */\n lineItemIds?: string[];\n /**\n * Deprecated. Use `benefits`, which supports memberships with more than one benefit.\n * @deprecated\n * @replacedBy benefits\n */\n credits?: MembershipPaymentCredits;\n /**\n * Membership expiration date.\n * @deprecated\n * @replacedBy offering_description\n */\n expirationDate?: Date | null;\n /**\n * Deprecated. Use `benefits.additional_data` for benefit-specific provider data.\n * @deprecated\n */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface MembershipName {\n /**\n * Membership name.\n * @maxLength 100\n */\n original?: string;\n /**\n * Translated membership name. Defaults to `original` when not provided.\n * @maxLength 100\n */\n translated?: string | null;\n}\n\nexport interface MembershipPaymentCredits {\n /**\n * Membership's initial value.\n * @min 1\n */\n total?: number;\n /** Membership's remaining value. */\n remaining?: number;\n}\n\nexport enum BalanceType {\n /** Balance is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Balance is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\n/**\n * A single redeemable benefit granted by a membership or a purchasable plan.\n * Used by the per-benefit redemption flow (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`).\n */\nexport interface Benefit extends BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n /**\n * Identifier for this benefit. Must be unique within the response so the response-level `coverages`\n * (`LineItemCoverage.benefit_id`) can reference it unambiguously across memberships/plans.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Human-readable label for this benefit (for example, \"Manicure\" or \"Pedicure\" on multi-set punchcards).\n * @maxLength 200\n */\n label?: string | null;\n /**\n * The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),\n * or an unbounded amount that is never drawn down (`UNLIMITED`).\n */\n quotaType?: QuotaType;\n}\n\n/** @oneof */\nexport interface BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n}\n\nexport enum QuotaType {\n /** The benefit grants a countable quota that is drawn down on redemption. */\n LIMITED = 'LIMITED',\n /** The benefit is unlimited (unbounded) and is never drawn down. */\n UNLIMITED = 'UNLIMITED',\n}\n\n/** A limited, countable redeemable amount. */\nexport interface LimitedQuota {\n /**\n * The quota's initial value.\n * @min 1\n */\n total?: number;\n /** The quota's remaining value. */\n remaining?: number;\n /** How the quota is measured. */\n limitedQuotaType?: LimitedQuotaType;\n}\n\nexport enum LimitedQuotaType {\n /** Quota is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Quota is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\nexport interface InvalidMembership {\n /** The membership that is invalid and cannot be used. */\n membership?: Membership;\n /**\n * Reason why this membership is invalid.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string;\n}\n\nexport interface MembershipInvalidSelectionErrors {\n /**\n * Error details for invalid memberships.\n * @maxSize 300\n */\n membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];\n}\n\nexport interface MembershipInvalidSelectionError\n extends MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n /**\n * Membership ID.\n * @format GUID\n */\n membershipId?: string;\n /** Error type. */\n errorType?: MembershipErrorType;\n}\n\n/** @oneof */\nexport interface MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n}\n\nexport enum MembershipErrorType {\n UNKNOWN = 'UNKNOWN',\n /** Membership not found. */\n MEMBERSHIP_NOT_FOUND = 'MEMBERSHIP_NOT_FOUND',\n /** The selection points to a line item ID that wasn't provided. */\n LINE_ITEM_NOT_FOUND = 'LINE_ITEM_NOT_FOUND',\n /** The membership cannot be used for the specific line items provided. */\n MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS = 'MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS',\n /** The membership can be used for each individual line item, but combining all of them is invalid. */\n MEMBERSHIP_SELECTION_INVALID = 'MEMBERSHIP_SELECTION_INVALID',\n}\n\nexport interface LineItemNotFoundInfo {\n /**\n * Line item IDs that were missing.\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemsInfo {\n /**\n * Line items that cannot be used with this membership, and the reason why.\n * @maxSize 300\n */\n lineItems?: MembershipCannotBeUsedForLineItemInfo[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemInfo {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * Reason why this line item cannot be used with this membership.\n * @maxLength 1000\n */\n reason?: string;\n}\n\nexport interface ListExistingMembershipsRequest {\n /**\n * The line items for which to list memberships the member already owns.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n}\n\nexport interface ListExistingMembershipsResponse {\n /**\n * Memberships the member already owns that apply to one or more input line items.\n * @maxSize 300\n */\n existingMemberships?: Membership[];\n /**\n * How the returned benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\n/**\n * Maps a benefit to a line item it can cover, and at what cost. Returned (nested) alongside `benefits`\n * and linked to a benefit by `benefit_id`. One entry per (benefit, line item).\n */\nexport interface LineItemCoverage {\n /**\n * The benefit that covers the line item, as returned in `Benefit.benefit_id`.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * The line item this benefit covers.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the benefit's `limited_quota.remaining` value for this item.\n * Always 0 for an unlimited benefit (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\nexport interface ListPurchasablePlansRequest {\n /**\n * The line items for which to list plans the member could purchase.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n}\n\nexport interface ListPurchasablePlansResponse {\n /**\n * Plans the member could purchase that would cover one or more input line items.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the returned plans' benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface PurchasablePlan {\n /** Catalog and item reference for the plan that can be purchased. */\n catalogReference?: CatalogReference;\n /** Plan name. */\n name?: MembershipName;\n /**\n * Benefits the plan would grant once purchased. Multiple entries support multi-benefit plans (e.g., a bundle granting separate yoga and pilates credits).\n * @minSize 1\n * @maxSize 50\n */\n benefits?: Benefit[];\n /**\n * Human-readable offering summary for display (for example price and validity text). Provider-supplied.\n * @maxLength 500\n */\n offeringDescription?: string | null;\n /**\n * URL the buyer is redirected to in order to collect additional info required to purchase this plan.\n * @format WEB_URL\n */\n infoCollectionUrl?: string | null;\n /**\n * Plan price.\n * @decimalValue options { gte:0, maxScale:3 }\n */\n price?: string;\n}\n\nexport interface EnhanceAndValidateSelectionRequest {\n /**\n * Memberships the caller has selected from the member's existing memberships pool.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipInput[];\n /**\n * Future memberships the caller intends to purchase as part of this checkout.\n * @maxSize 300\n */\n futureMemberships?: FutureMembershipInput[];\n /**\n * Member ID.\n *\n * Required when `existing_memberships` is not empty; omitted for future-memberships-only selections.\n * Optional (StringValue) so an absent member id is sent unset rather than as an empty string, which would fail GUID validation.\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ExistingMembershipInput {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Line items the caller intends to redeem against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembershipInput {\n /** Catalog reference of the plan that will be purchased. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Line items the caller intends to redeem against the future membership.\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface EnhanceAndValidateSelectionResponse {\n /**\n * Validated and enhanced existing membership selections.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipEnhanced[];\n /**\n * Validated and enhanced future membership selections.\n * @maxSize 300\n */\n futureMemberships?: FutureMembership[];\n}\n\nexport interface ExistingMembershipEnhanced {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n /**\n * Validated line items redeemed against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembership {\n /** Catalog reference of the validated future membership. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n}\n\nexport interface ChargeMembershipRequest {\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value is typically `membershipId` + `orderId` + `rootCatalogItemId`.\n * @minLength 1\n * @maxLength 200\n */\n idempotencyKey: string;\n /**\n * Service properties.\n *\n * When relevant, this contains information such as date and number of participants.\n */\n serviceProperties?: ServiceProperties;\n /** Catalog and item reference info. */\n catalogReference: CatalogReference;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n /** Additional data about this charge. */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface ChargeMembershipResponse {\n /**\n * The transaction ID for this charge.\n *\n * Use this ID to void the charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface MembershipCannotBeChargedError\n extends MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n /** Error type. */\n errorType?: MembershipCannotBeChargedType;\n}\n\n/** @oneof */\nexport interface MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n}\n\nexport enum MembershipCannotBeChargedType {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n OUT_OF_CREDITS = 'OUT_OF_CREDITS',\n /** Membership has not become active yet. */\n NOT_STARTED_YET = 'NOT_STARTED_YET',\n /** Membership has expired or ended. */\n ENDED = 'ENDED',\n /** Not applicable for multiple participants. */\n NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS = 'NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS',\n}\n\nexport interface OutOfCredits {\n /** Required amount of credits. */\n required?: number;\n /** Remaining amount of credits. */\n remaining?: number;\n}\n\nexport interface NotStartedYet {\n /** Start date of the membership. */\n membershipStartDate?: Date | null;\n}\n\nexport interface Ended {\n /** End date of the membership. */\n endDate?: Date | null;\n}\n\nexport interface MembershipAlreadyChargedError {\n /**\n * ID of the transaction that was already used for membership charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface GetMembershipVoidabilityRequest {\n /**\n * Transaction ID to check if it can be voided.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface GetMembershipVoidabilityResponse {\n /** Whether the membership charge can be voided. */\n voidable?: boolean;\n /**\n * Reason why the membership charge cannot be voided.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string | null;\n}\n\nexport interface VoidMembershipChargeRequest {\n /**\n * Transaction ID to void.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface VoidMembershipChargeResponse {}\n\nexport interface MembershipsSPIConfig {\n /**\n * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.\n * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.\n * @format WEB_URL\n */\n deploymentUri?: string;\n /**\n * The app IDs of the catalogs your app supports.\n * @minSize 1\n * @maxSize 300\n * @format GUID\n */\n catalogAppDefIds?: string[];\n /**\n * Set to true once your app implements the updated redemption methods (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`)\n * and the per-balance redemption model. While false, Wix eCommerce keeps calling the legacy `ListEligibleMemberships` flow.\n * This toggle lets providers migrate without a synchronized deploy and is removed once migration completes.\n */\n toggleUpdatedMethodsEnabled?: boolean;\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,2BAAN,cAAuC,MAAM;AAAA,EAkBlD,YAAY,OAAyC,CAAC,GAAG;AACvD,UAAM,kBAAkB;AAExB,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,kBACH;AACF,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAEA,SAAK,OAAO;AAAA,EACd;AAIF;AAAA;AAtCa,yBAqCK,SAAS;AAMp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U;AAEV,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,8CAA2C;AAE3C,EAAAA,qBAAA,kCAA+B;AATrB,SAAAA;AAAA,GAAA;AA+TL,IAAK,gCAAL,kBAAKC,mCAAL;AAEL,EAAAA,+BAAA,oBAAiB;AAEjB,EAAAA,+BAAA,qBAAkB;AAElB,EAAAA,+BAAA,WAAQ;AAER,EAAAA,+BAAA,8CAA2C;AARjC,SAAAA;AAAA,GAAA;AA0HL,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":["BalanceType","QuotaType","LimitedQuotaType","MembershipErrorType","MembershipCannotBeChargedType","IdentityType"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import {\n ListEligibleMembershipsResponse,\n ChargeMembershipResponse,\n GetMembershipVoidabilityResponse,\n VoidMembershipChargeResponse,\n} from './src/service-plugins-types.js';\nimport {\n ListEligibleMembershipsEnvelope,\n ChargeMembershipEnvelope,\n GetMembershipVoidabilityEnvelope,\n VoidMembershipChargeEnvelope,\n} from './src/interfaces-ecom-v1-memberships-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport {\n ListEligibleMembershipsEnvelope,\n ChargeMembershipEnvelope,\n GetMembershipVoidabilityEnvelope,\n VoidMembershipChargeEnvelope,\n};\n\n/**\n * Deprecated. Use `ListExistingMemberships` + `ListPurchasablePlans` for read, and `EnhanceAndValidateSelection` for selection validation.\n * @throws InvalidSelectionWixError\n * @throws InsufficientBalanceWixError\n */\nexport declare function listEligibleMemberships(\n payload: ListEligibleMembershipsEnvelope\n): ListEligibleMembershipsResponse | Promise<ListEligibleMembershipsResponse>;\n/**\n * This method requests that a membership be charged by your app.\n * @throws MembershipDoesNotApplyToItemWixError\n * @throws MembershipCannotBeUsedWixError\n * @throws MembershipAlreadyChargedWixError\n */\nexport declare function chargeMembership(\n payload: ChargeMembershipEnvelope\n): ChargeMembershipResponse | Promise<ChargeMembershipResponse>;\n/**\n * This method retrieves from your app whether a membership can be voided.\n * @throws TransactionNotFoundWixError\n */\nexport declare function getMembershipVoidability(\n payload: GetMembershipVoidabilityEnvelope\n): GetMembershipVoidabilityResponse | Promise<GetMembershipVoidabilityResponse>;\n/**\n * This method requests that a membership charge be voided by your app.\n * @throws TransactionNotFoundWixError\n * @throws TransactionCannotBeVoidedWixError\n * @throws TransactionAlreadyVoidedWixError\n */\nexport declare function voidMembershipCharge(\n payload: VoidMembershipChargeEnvelope\n): VoidMembershipChargeResponse | Promise<VoidMembershipChargeResponse>;\n","import {\n MembershipInvalidSelectionErrors,\n MembershipCannotBeChargedError,\n MembershipAlreadyChargedError,\n} from './service-plugins-types.js';\n\n/**\n * The provided membership selection is invalid\n */\nexport class InvalidSelectionWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipInvalidSelectionErrors;\n\n constructor(data: MembershipInvalidSelectionErrors = {}) {\n super('InvalidSelection');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_SELECTION';\n this.name = 'InvalidSelection';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipInvalidSelectionErrors';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidSelection',\n applicationCode: 'INVALID_SELECTION',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The selected memberships do not have enough balance to cover the line items.\n */\nexport class InsufficientBalanceWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InsufficientBalance');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'INSUFFICIENT_BALANCE';\n this.name = 'InsufficientBalance';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InsufficientBalance',\n applicationCode: 'INSUFFICIENT_BALANCE',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, but does not apply for the provided item\n */\nexport class MembershipDoesNotApplyToItemWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MembershipDoesNotApplyToItem');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM';\n this.name = 'MembershipDoesNotApplyToItem';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipDoesNotApplyToItem',\n applicationCode: 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, applied to the provided item but cannot be charged. For example because a limited membership doesn't have enough credits\n */\nexport class MembershipCannotBeUsedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipCannotBeChargedError;\n\n constructor(data: MembershipCannotBeChargedError = {}) {\n super('MembershipCannotBeUsed');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MEMBERSHIP_CANNOT_BE_CHARGED';\n this.name = 'MembershipCannotBeUsed';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipCannotBeChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipCannotBeUsed',\n applicationCode: 'MEMBERSHIP_CANNOT_BE_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * This charge was already done, per the idempotency key of membershipId + orderId + rootCatalogItemId\n */\nexport class MembershipAlreadyChargedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipAlreadyChargedError;\n\n constructor(data: MembershipAlreadyChargedError = {}) {\n super('MembershipAlreadyCharged');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'MEMBERSHIP_ALREADY_CHARGED';\n this.name = 'MembershipAlreadyCharged';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipAlreadyChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipAlreadyCharged',\n applicationCode: 'MEMBERSHIP_ALREADY_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction not found\n */\nexport class TransactionNotFoundWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionNotFound');\n\n this.httpCode = 404;\n this.statusCode = 'NOT_FOUND';\n this.applicationCode = 'TRANSACTION_NOT_FOUND';\n this.name = 'TransactionNotFound';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionNotFound',\n applicationCode: 'TRANSACTION_NOT_FOUND',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction exists but cannot be voided\n */\nexport class TransactionCannotBeVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionCannotBeVoided');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'TRANSACTION_CANNOT_BE_VOIDED';\n this.name = 'TransactionCannotBeVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionCannotBeVoided',\n applicationCode: 'TRANSACTION_CANNOT_BE_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction was already voided\n */\nexport class TransactionAlreadyVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionAlreadyVoided');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'TRANSACTION_ALREADY_VOIDED';\n this.name = 'TransactionAlreadyVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionAlreadyVoided',\n applicationCode: 'TRANSACTION_ALREADY_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","export interface ListEligibleMembershipsRequest {\n /**\n * The line items for which to list eligible memberships.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * The selected payment memberships and which line items they apply to.\n *\n * When not provided, your implementation is expected to return the default selection.\n * When provided, your implementation is expected to validate and return it.\n */\n selectedMemberships?: SelectedMemberships;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Catalog and item reference info. */\n catalogReference?: CatalogReference;\n /** Properties of the service. When relevant, contains information such as date and number of participants. */\n serviceProperties?: ServiceProperties;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n *\n * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface ServiceProperties {\n /**\n * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.\n * For example, the start time of a class.\n */\n scheduledDate?: Date | null;\n /**\n * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.\n * @min 1\n * @max 10000\n */\n numberOfParticipants?: number | null;\n}\n\nexport interface SelectedMemberships {\n /**\n * Selected memberships.\n * @maxSize 300\n */\n memberships?: SelectedMembership[];\n}\n\nexport interface SelectedMembership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * IDs of the line items this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface ListEligibleMembershipsResponse {\n /**\n * List of memberships that are eligible for the given member and line items.\n * @maxSize 300\n */\n eligibleMemberships?: Membership[];\n /**\n * List of memberships owned by the member, but cannot be used due to the reason provided.\n * @maxSize 300\n */\n invalidMemberships?: InvalidMembership[];\n /**\n * List of selected memberships and which line items they apply to.\n * @maxSize 300\n */\n selectedMemberships?: SelectedMembership[];\n}\n\nexport interface Membership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Membership name. */\n name?: MembershipName;\n /**\n * Deprecated. Use the response-level `coverages` (`LineItemCoverage`) to see which line items each benefit covers.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n * @deprecated\n * @replacedBy coverages.line_item_id\n */\n lineItemIds?: string[];\n /**\n * Deprecated. Use `benefits`, which supports memberships with more than one benefit.\n * @deprecated\n * @replacedBy benefits\n */\n credits?: MembershipPaymentCredits;\n /**\n * Membership expiration date.\n * @deprecated\n * @replacedBy offering_description\n */\n expirationDate?: Date | null;\n /**\n * Deprecated. Use `benefits.additional_data` for benefit-specific provider data.\n * @deprecated\n */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface MembershipName {\n /**\n * Membership name.\n * @maxLength 100\n */\n original?: string;\n /**\n * Translated membership name. Defaults to `original` when not provided.\n * @maxLength 100\n */\n translated?: string | null;\n}\n\nexport interface MembershipPaymentCredits {\n /**\n * Membership's initial value.\n * @min 1\n */\n total?: number;\n /** Membership's remaining value. */\n remaining?: number;\n}\n\nexport enum BalanceType {\n /** Balance is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Balance is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\n/**\n * A single redeemable benefit granted by a membership or a purchasable plan.\n * Used by the per-benefit redemption flow (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`).\n */\nexport interface Benefit extends BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n /**\n * Identifier for this benefit. Must be unique within the response so the response-level `coverages`\n * (`LineItemCoverage.benefit_id`) can reference it unambiguously across memberships/plans.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Human-readable label for this benefit (for example, \"Manicure\" or \"Pedicure\" on multi-set punchcards).\n * @maxLength 200\n */\n label?: string | null;\n /**\n * The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),\n * or an unbounded amount that is never drawn down (`UNLIMITED`).\n */\n quotaType?: QuotaType;\n}\n\n/** @oneof */\nexport interface BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n}\n\nexport enum QuotaType {\n /** The benefit grants a countable quota that is drawn down on redemption. */\n LIMITED = 'LIMITED',\n /** The benefit is unlimited (unbounded) and is never drawn down. */\n UNLIMITED = 'UNLIMITED',\n}\n\n/** A limited, countable redeemable amount. */\nexport interface LimitedQuota {\n /**\n * The quota's initial value.\n * @min 1\n */\n total?: number;\n /** The quota's remaining value. */\n remaining?: number;\n /** How the quota is measured. */\n limitedQuotaType?: LimitedQuotaType;\n}\n\nexport enum LimitedQuotaType {\n /** Quota is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Quota is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\nexport interface InvalidMembership {\n /** The membership that is invalid and cannot be used. */\n membership?: Membership;\n /**\n * Reason why this membership is invalid.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string;\n}\n\nexport interface MembershipInvalidSelectionErrors {\n /**\n * Error details for invalid memberships.\n * @maxSize 300\n */\n membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];\n}\n\nexport interface MembershipInvalidSelectionError\n extends MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n /**\n * Membership ID.\n * @format GUID\n */\n membershipId?: string;\n /** Error type. */\n errorType?: MembershipErrorType;\n}\n\n/** @oneof */\nexport interface MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n}\n\nexport enum MembershipErrorType {\n UNKNOWN = 'UNKNOWN',\n /** Membership not found. */\n MEMBERSHIP_NOT_FOUND = 'MEMBERSHIP_NOT_FOUND',\n /** The selection points to a line item ID that wasn't provided. */\n LINE_ITEM_NOT_FOUND = 'LINE_ITEM_NOT_FOUND',\n /** The membership cannot be used for the specific line items provided. */\n MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS = 'MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS',\n /** The membership can be used for each individual line item, but combining all of them is invalid. */\n MEMBERSHIP_SELECTION_INVALID = 'MEMBERSHIP_SELECTION_INVALID',\n}\n\nexport interface LineItemNotFoundInfo {\n /**\n * Line item IDs that were missing.\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemsInfo {\n /**\n * Line items that cannot be used with this membership, and the reason why.\n * @maxSize 300\n */\n lineItems?: MembershipCannotBeUsedForLineItemInfo[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemInfo {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * Reason why this line item cannot be used with this membership.\n * @maxLength 1000\n */\n reason?: string;\n}\n\nexport interface ListExistingMembershipsRequest {\n /**\n * The line items for which to list memberships the member already owns.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n}\n\nexport interface ListExistingMembershipsResponse {\n /**\n * Memberships the member already owns that apply to one or more input line items.\n * @maxSize 300\n */\n existingMemberships?: Membership[];\n /**\n * How the returned benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\n/**\n * Maps a benefit to a line item it can cover, and at what cost. Returned (nested) alongside `benefits`\n * and linked to a benefit by `benefit_id`. One entry per (benefit, line item).\n */\nexport interface LineItemCoverage {\n /**\n * The benefit that covers the line item, as returned in `Benefit.benefit_id`.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * The line item this benefit covers.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the benefit's `limited_quota.remaining` value for this item.\n * Always 0 for an unlimited benefit (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\nexport interface ListPurchasablePlansRequest {\n /**\n * The line items for which to list plans the member could purchase.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n}\n\nexport interface ListPurchasablePlansResponse {\n /**\n * Plans the member could purchase that would cover one or more input line items.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the returned plans' benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface PurchasablePlan {\n /** Catalog and item reference for the plan that can be purchased. */\n catalogReference?: CatalogReference;\n /** Plan name. */\n name?: MembershipName;\n /**\n * Benefits the plan would grant once purchased. Multiple entries support multi-benefit plans (e.g., a bundle granting separate yoga and pilates credits).\n * @minSize 1\n * @maxSize 50\n */\n benefits?: Benefit[];\n /**\n * Human-readable offering summary for display (for example price and validity text). Provider-supplied.\n * @maxLength 500\n */\n offeringDescription?: string | null;\n /**\n * URL the buyer is redirected to in order to collect additional info required to purchase this plan.\n * @format WEB_URL\n */\n infoCollectionUrl?: string | null;\n /**\n * Plan price.\n * @decimalValue options { gte:0, maxScale:3 }\n */\n price?: string;\n /**\n * Human-readable description of the plan price (for example \"First month free, then $20/month\").\n *\n * `price` is simply the price (useful for sorting or comparison, for example), while this is a\n * descriptive, display-oriented summary of it.\n * @maxLength 500\n */\n priceDescription?: string | null;\n}\n\nexport interface EnhanceAndValidateSelectionRequest {\n /**\n * Memberships the caller has selected from the member's existing memberships pool.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipInput[];\n /**\n * Future memberships the caller intends to purchase as part of this checkout.\n * @maxSize 300\n */\n futureMemberships?: FutureMembershipInput[];\n /**\n * Member ID.\n *\n * Required when `existing_memberships` is not empty; omitted for future-memberships-only selections.\n * Optional (StringValue) so an absent member id is sent unset rather than as an empty string, which would fail GUID validation.\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ExistingMembershipInput {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Line items the caller intends to redeem against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembershipInput {\n /** Catalog reference of the plan that will be purchased. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Line items the caller intends to redeem against the future membership.\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface EnhanceAndValidateSelectionResponse {\n /**\n * Validated and enhanced existing membership selections.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipEnhanced[];\n /**\n * Validated and enhanced future membership selections.\n * @maxSize 300\n */\n futureMemberships?: FutureMembership[];\n}\n\nexport interface ExistingMembershipEnhanced {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n /**\n * Validated line items redeemed against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembership {\n /** Catalog reference of the validated future membership. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n}\n\nexport interface ChargeMembershipRequest {\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value is typically `membershipId` + `orderId` + `rootCatalogItemId`.\n * @minLength 1\n * @maxLength 200\n */\n idempotencyKey: string;\n /**\n * Service properties.\n *\n * When relevant, this contains information such as date and number of participants.\n */\n serviceProperties?: ServiceProperties;\n /** Catalog and item reference info. */\n catalogReference: CatalogReference;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n /** Additional data about this charge. */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface ChargeMembershipResponse {\n /**\n * The transaction ID for this charge.\n *\n * Use this ID to void the charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface MembershipCannotBeChargedError\n extends MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n /** Error type. */\n errorType?: MembershipCannotBeChargedType;\n}\n\n/** @oneof */\nexport interface MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n}\n\nexport enum MembershipCannotBeChargedType {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n OUT_OF_CREDITS = 'OUT_OF_CREDITS',\n /** Membership has not become active yet. */\n NOT_STARTED_YET = 'NOT_STARTED_YET',\n /** Membership has expired or ended. */\n ENDED = 'ENDED',\n /** Not applicable for multiple participants. */\n NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS = 'NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS',\n}\n\nexport interface OutOfCredits {\n /** Required amount of credits. */\n required?: number;\n /** Remaining amount of credits. */\n remaining?: number;\n}\n\nexport interface NotStartedYet {\n /** Start date of the membership. */\n membershipStartDate?: Date | null;\n}\n\nexport interface Ended {\n /** End date of the membership. */\n endDate?: Date | null;\n}\n\nexport interface MembershipAlreadyChargedError {\n /**\n * ID of the transaction that was already used for membership charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface GetMembershipVoidabilityRequest {\n /**\n * Transaction ID to check if it can be voided.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface GetMembershipVoidabilityResponse {\n /** Whether the membership charge can be voided. */\n voidable?: boolean;\n /**\n * Reason why the membership charge cannot be voided.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string | null;\n}\n\nexport interface VoidMembershipChargeRequest {\n /**\n * Transaction ID to void.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface VoidMembershipChargeResponse {}\n\nexport interface MembershipsSPIConfig {\n /**\n * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.\n * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.\n * @format WEB_URL\n */\n deploymentUri?: string;\n /**\n * The app IDs of the catalogs your app supports.\n * @minSize 1\n * @maxSize 300\n * @format GUID\n */\n catalogAppDefIds?: string[];\n /**\n * Set to true once your app implements the updated redemption methods (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`)\n * and the per-balance redemption model. While false, Wix eCommerce keeps calling the legacy `ListEligibleMemberships` flow.\n * This toggle lets providers migrate without a synchronized deploy and is removed once migration completes.\n */\n toggleUpdatedMethodsEnabled?: boolean;\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,2BAAN,cAAuC,MAAM;AAAA,EAkBlD,YAAY,OAAyC,CAAC,GA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AL,kBAAKC,eAAL;AAEL,EAAAA,WAAA,aAAU;AAEV,EAAAA,WAAA,eAAY;AAJF,SAAAA;AAAA,GAAA;AAoBL,IAAK,mBAAL,kBAAKC,sBAAL;AAEL,EAAAA,kBAAA,gBAAa;AAEb,EAAAA,kBAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AA2DL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,aAAU;AAEV,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,8CAA2C;AAE3C,EAAAA,qBAAA,kCAA+B;AATrB,SAAAA;AAAA,GAAA;AAuUL,IAAK,gCAAL,kBAAKC,mCAAL;AAEL,EAAAA,+BAAA,oBAAiB;AAEjB,EAAAA,+BAAA,qBAAkB;AAElB,EAAAA,+BAAA,WAAQ;AAER,EAAAA,+BAAA,8CAA2C;AARjC,SAAAA;AAAA,GAAA;AA0HL,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":["BalanceType","QuotaType","LimitedQuotaType","MembershipErrorType","MembershipCannotBeChargedType","IdentityType"]}
|
|
@@ -428,6 +428,14 @@ interface PurchasablePlan {
|
|
|
428
428
|
* @decimalValue options { gte:0, maxScale:3 }
|
|
429
429
|
*/
|
|
430
430
|
price?: string;
|
|
431
|
+
/**
|
|
432
|
+
* Human-readable description of the plan price (for example "First month free, then $20/month").
|
|
433
|
+
*
|
|
434
|
+
* `price` is simply the price (useful for sorting or comparison, for example), while this is a
|
|
435
|
+
* descriptive, display-oriented summary of it.
|
|
436
|
+
* @maxLength 500
|
|
437
|
+
*/
|
|
438
|
+
priceDescription?: string | null;
|
|
431
439
|
}
|
|
432
440
|
interface EnhanceAndValidateSelectionRequest {
|
|
433
441
|
/**
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as provideHandlers$1 } from './service-plugins-error-classes-
|
|
2
|
-
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference, D as ChargeMembershipRequest, G as ChargeMembershipResponse, Z as Context, R as Ended, E as EnhanceAndValidateSelectionRequest, y as EnhanceAndValidateSelectionResponse, z as ExistingMembershipEnhanced, x as ExistingMembershipInput, A as FutureMembership, F as FutureMembershipInput, U as GetMembershipVoidabilityRequest, V as GetMembershipVoidabilityResponse, $ as IdentificationData, a0 as IdentificationDataIdOneOf, _ as IdentityType, a2 as InsufficientBalanceWixError, I as InvalidMembership, a1 as InvalidSelectionWixError, i as LimitedQuota, j as LimitedQuotaType, a as LineItem, u as LineItemCoverage, o as LineItemNotFoundInfo, L as ListEligibleMembershipsRequest, d as ListEligibleMembershipsResponse, s as ListExistingMembershipsRequest, t as ListExistingMembershipsResponse, v as ListPurchasablePlansRequest, w as ListPurchasablePlansResponse, M as Membership, T as MembershipAlreadyChargedError, a5 as MembershipAlreadyChargedWixError, H as MembershipCannotBeChargedError, J as MembershipCannotBeChargedErrorErrorDataOneOf, K as MembershipCannotBeChargedType, r as MembershipCannotBeUsedForLineItemInfo, q as MembershipCannotBeUsedForLineItemsInfo, a4 as MembershipCannotBeUsedWixError, a3 as MembershipDoesNotApplyToItemWixError, n as MembershipErrorType, l as MembershipInvalidSelectionError, m as MembershipInvalidSelectionErrorErrorDataOneOf, k as MembershipInvalidSelectionErrors, e as MembershipName, f as MembershipPaymentCredits, Y as MembershipsSPIConfig, N as NotStartedYet, O as OutOfCredits, P as PurchasablePlan, Q as QuotaType, c as SelectedMembership, b as SelectedMemberships, S as ServiceProperties, a8 as TransactionAlreadyVoidedWixError, a7 as TransactionCannotBeVoidedWixError, a6 as TransactionNotFoundWixError, W as VoidMembershipChargeRequest, X as VoidMembershipChargeResponse } from './service-plugins-error-classes-
|
|
1
|
+
import { p as provideHandlers$1 } from './service-plugins-error-classes-BhKAiJNy.mjs';
|
|
2
|
+
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference, D as ChargeMembershipRequest, G as ChargeMembershipResponse, Z as Context, R as Ended, E as EnhanceAndValidateSelectionRequest, y as EnhanceAndValidateSelectionResponse, z as ExistingMembershipEnhanced, x as ExistingMembershipInput, A as FutureMembership, F as FutureMembershipInput, U as GetMembershipVoidabilityRequest, V as GetMembershipVoidabilityResponse, $ as IdentificationData, a0 as IdentificationDataIdOneOf, _ as IdentityType, a2 as InsufficientBalanceWixError, I as InvalidMembership, a1 as InvalidSelectionWixError, i as LimitedQuota, j as LimitedQuotaType, a as LineItem, u as LineItemCoverage, o as LineItemNotFoundInfo, L as ListEligibleMembershipsRequest, d as ListEligibleMembershipsResponse, s as ListExistingMembershipsRequest, t as ListExistingMembershipsResponse, v as ListPurchasablePlansRequest, w as ListPurchasablePlansResponse, M as Membership, T as MembershipAlreadyChargedError, a5 as MembershipAlreadyChargedWixError, H as MembershipCannotBeChargedError, J as MembershipCannotBeChargedErrorErrorDataOneOf, K as MembershipCannotBeChargedType, r as MembershipCannotBeUsedForLineItemInfo, q as MembershipCannotBeUsedForLineItemsInfo, a4 as MembershipCannotBeUsedWixError, a3 as MembershipDoesNotApplyToItemWixError, n as MembershipErrorType, l as MembershipInvalidSelectionError, m as MembershipInvalidSelectionErrorErrorDataOneOf, k as MembershipInvalidSelectionErrors, e as MembershipName, f as MembershipPaymentCredits, Y as MembershipsSPIConfig, N as NotStartedYet, O as OutOfCredits, P as PurchasablePlan, Q as QuotaType, c as SelectedMembership, b as SelectedMemberships, S as ServiceProperties, a8 as TransactionAlreadyVoidedWixError, a7 as TransactionCannotBeVoidedWixError, a6 as TransactionNotFoundWixError, W as VoidMembershipChargeRequest, X as VoidMembershipChargeResponse } from './service-plugins-error-classes-BhKAiJNy.mjs';
|
|
3
3
|
import { BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
|