@wix/auto_sdk_ecom_memberships 1.0.12 → 1.0.14

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.
@@ -0,0 +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. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.\n *\n * For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).\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 * Line item IDs this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n /** Total and remaining membership credits. */\n credits?: MembershipPaymentCredits;\n /** Membership expiration date. */\n expirationDate?: Date | null;\n /** Additional data about this membership. */\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 total amount of credits.\n * @min 1\n */\n total?: number;\n /** Membership's remaining amount of credits. */\n remaining?: number;\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 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, as returned from the List Eligible Memberships call.\n * @minLength 1\n * @maxLength 100\n */\n membershipId: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value will usually would be the same as `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\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 * This method retrieves eligible memberships from your app. */\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 ],\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: [{ path: 'request.serviceProperties.scheduledDate' }],\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> = createServicePluginModule(publicProvideHandlers);\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 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"],"mapp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AMpB,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","MembershipErrorType","MembershipCannotBeChargedType","IdentityType","import_timestamp","provideHandlers"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../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 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. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.\n *\n * For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).\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 * Line item IDs this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n /** Total and remaining membership credits. */\n credits?: MembershipPaymentCredits;\n /** Membership expiration date. */\n expirationDate?: Date | null;\n /** Additional data about this membership. */\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 total amount of credits.\n * @min 1\n */\n total?: number;\n /** Membership's remaining amount of credits. */\n remaining?: number;\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 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, as returned from the List Eligible Memberships call.\n * @minLength 1\n * @maxLength 100\n */\n membershipId: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value will usually would be the same as `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\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 * This method retrieves eligible memberships from your app. */\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 ],\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: [{ path: 'request.serviceProperties.scheduledDate' }],\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> = createServicePluginModule(publicProvideHandlers);\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 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":";AAuOO,IAAK,sBAAL,kBAAKA,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;AAwHL,IAAK,gCAAL,kBAAKC,mCAAL;AAEL,EAAAA,+BAAA,oBAAiB;AAEjB,EAAAA,+BAAA,qBAAkB;AAElB,EAAAA,+BAAA,WAAQ;AAER,EAAAA,+BAAA,8CAA2C;AARjC,SAAAA;AAAA,GAAA;AAoHL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;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,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":["MembershipErrorType","MembershipCannotBeChargedType","IdentityType","provideHandlers"]}
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_ecom_memberships",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
7
7
  },
8
8
  "keywords": [],
9
9
  "sideEffects": false,
10
- "main": "/build/index.js",
11
- "types": "./build/index.d.mts",
10
+ "main": "./build/cjs/index.js",
11
+ "types": "./build/cjs/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./build/index.mjs",
15
- "require": "./build/index.js",
16
- "types": "./build/index.d.mts"
14
+ "import": "./build/es/index.mjs",
15
+ "require": "./build/cjs/index.js",
16
+ "types": "./build/es/index.d.mts"
17
17
  },
18
18
  "./package.json": "./package.json",
19
19
  "./meta": {
20
- "import": "./build/meta.mjs",
21
- "require": "./build/meta.js",
22
- "types": "./build/meta.d.mts"
20
+ "import": "./build/es/meta.mjs",
21
+ "require": "./build/cjs/meta.js",
22
+ "types": "./build/es/meta.d.mts"
23
23
  }
24
24
  },
25
25
  "files": [
@@ -28,7 +28,7 @@
28
28
  "service-plugins"
29
29
  ],
30
30
  "dependencies": {
31
- "@wix/sdk-runtime": "^0.3.49",
31
+ "@wix/sdk-runtime": "^0.3.55",
32
32
  "@wix/sdk-types": "^1.13.28"
33
33
  },
34
34
  "devDependencies": {
@@ -49,5 +49,5 @@
49
49
  "fqdn": "wix.interfaces.ecom.v1.memberships_provider"
50
50
  }
51
51
  },
52
- "falconPackageHash": "b3636d5c0253adb21a8b6455b8d756146ee08a17321dbd0df294c874"
52
+ "falconPackageHash": "eb0c8df7146d9869d66824516078566073461e675dca5945bfb8cb96"
53
53
  }
@@ -1 +0,0 @@
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. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.\n *\n * For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).\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 * Line item IDs this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n /** Total and remaining membership credits. */\n credits?: MembershipPaymentCredits;\n /** Membership expiration date. */\n expirationDate?: Date | null;\n /** Additional data about this membership. */\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 total amount of credits.\n * @min 1\n */\n total?: number;\n /** Membership's remaining amount of credits. */\n remaining?: number;\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 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, as returned from the List Eligible Memberships call.\n * @minLength 1\n * @maxLength 100\n */\n membershipId: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value will usually would be the same as `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\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 * This method retrieves eligible memberships from your app. */\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 ],\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: [{ path: 'request.serviceProperties.scheduledDate' }],\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> = createServicePluginModule(publicProvideHandlers);\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 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;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,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","MembershipErrorType","MembershipCannotBeChargedType","IdentityType","import_timestamp","provideHandlers"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../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 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. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.\n *\n * For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).\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 * Line item IDs this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n /** Total and remaining membership credits. */\n credits?: MembershipPaymentCredits;\n /** Membership expiration date. */\n expirationDate?: Date | null;\n /** Additional data about this membership. */\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 total amount of credits.\n * @min 1\n */\n total?: number;\n /** Membership's remaining amount of credits. */\n remaining?: number;\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 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, as returned from the List Eligible Memberships call.\n * @minLength 1\n * @maxLength 100\n */\n membershipId: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value will usually would be the same as `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\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 * This method retrieves eligible memberships from your app. */\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 ],\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: [{ path: 'request.serviceProperties.scheduledDate' }],\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> = createServicePluginModule(publicProvideHandlers);\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 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":";AAuOO,IAAK,sBAAL,kBAAKA,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;AAwHL,IAAK,gCAAL,kBAAKC,mCAAL;AAEL,EAAAA,+BAAA,oBAAiB;AAEjB,EAAAA,+BAAA,qBAAkB;AAElB,EAAAA,+BAAA,WAAQ;AAER,EAAAA,+BAAA,8CAA2C;AARjC,SAAAA;AAAA,GAAA;AAoHL,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;;;ACndZ,SAAS,+BAA+B;AAYxC,SAAS,4CAA4C;AACr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K,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,iCA6BK,SAAS;","names":["MembershipErrorType","MembershipCannotBeChargedType","IdentityType","provideHandlers"]}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes