{"version":3,"sources":["../../src/ecom-v1-gift-card-gift-vouchers.http.ts","../../src/ecom-v1-gift-card-gift-vouchers.meta.ts"],"sourcesContent":["import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEcomGiftCardsSpiHostV1GiftCardsSpiHostServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/gift-cards-spi-host',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/ecom/v1/gift-cards',\n        destPath: '/v1/gift-cards',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/ecom/v1/gift-cards',\n        destPath: '/v1/gift-cards',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_gift-vouchers';\n\n/** Retrieves a gift card. */\nexport function getGiftCard(payload: object): RequestOptionsFactory<any> {\n  function __getGiftCard({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ecom.v1.gift_card',\n      method: 'POST' as any,\n      methodFqn:\n        'wix.ecom.gift_cards_spi_host.v1.GiftCardsSpiHostService.GetGiftCard',\n      packageName: PACKAGE_NAME,\n      url: resolveWixEcomGiftCardsSpiHostV1GiftCardsSpiHostServiceUrl({\n        protoPath: '/v1/gift-cards/{code}',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __getGiftCard;\n}\n\n/**\n * Redeems a gift card.\n * Creates a transaction and lowers the card balance by the transaction amount.\n */\nexport function redeemGiftCard(payload: object): RequestOptionsFactory<any> {\n  function __redeemGiftCard({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ecom.v1.gift_card',\n      method: 'POST' as any,\n      methodFqn:\n        'wix.ecom.gift_cards_spi_host.v1.GiftCardsSpiHostService.RedeemGiftCard',\n      packageName: PACKAGE_NAME,\n      url: resolveWixEcomGiftCardsSpiHostV1GiftCardsSpiHostServiceUrl({\n        protoPath: '/v1/gift-cards/redeem',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __redeemGiftCard;\n}\n\n/**\n * Voids a gift card transaction.\n * Transaction IDs are returned in Redeem Gift Card.\n */\nexport function voidTransaction(payload: object): RequestOptionsFactory<any> {\n  function __voidTransaction({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ecom.v1.gift_card',\n      method: 'POST' as any,\n      methodFqn:\n        'wix.ecom.gift_cards_spi_host.v1.GiftCardsSpiHostService.VoidTransaction',\n      packageName: PACKAGE_NAME,\n      url: resolveWixEcomGiftCardsSpiHostV1GiftCardsSpiHostServiceUrl({\n        protoPath: '/v1/gift-cards/void',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __voidTransaction;\n}\n","import * as ambassadorWixEcomV1GiftCard from './ecom-v1-gift-card-gift-vouchers.http.js';\nimport * as ambassadorWixEcomV1GiftCardTypes from './ecom-v1-gift-card-gift-vouchers.types.js';\nimport * as ambassadorWixEcomV1GiftCardUniversalTypes from './ecom-v1-gift-card-gift-vouchers.universal.js';\n\nexport type __PublicMethodMetaInfo<\n  K = string,\n  M = unknown,\n  T = unknown,\n  S = unknown,\n  Q = unknown,\n  R = unknown\n> = {\n  getUrl: (context: any) => string;\n  httpMethod: K;\n  path: string;\n  pathParams: M;\n  __requestType: T;\n  __originalRequestType: S;\n  __responseType: Q;\n  __originalResponseType: R;\n};\n\nexport function getGiftCard(): __PublicMethodMetaInfo<\n  'POST',\n  { code: string },\n  ambassadorWixEcomV1GiftCardUniversalTypes.GetGiftCardRequest,\n  ambassadorWixEcomV1GiftCardTypes.GetGiftCardRequest,\n  ambassadorWixEcomV1GiftCardUniversalTypes.GetGiftCardResponse &\n    ambassadorWixEcomV1GiftCardUniversalTypes.GetGiftCardResponseNonNullableFields,\n  ambassadorWixEcomV1GiftCardTypes.GetGiftCardResponse &\n    ambassadorWixEcomV1GiftCardTypes.GetGiftCardResponseNonNullableFields\n> {\n  const payload = { code: ':code' } as any;\n\n  const getRequestOptions = ambassadorWixEcomV1GiftCard.getGiftCard(payload);\n\n  const getUrl = (context: any): string => {\n    const { url } = getRequestOptions(context);\n    return url!;\n  };\n\n  return {\n    getUrl,\n    httpMethod: 'POST',\n    path: '/v1/gift-cards/{code}',\n    pathParams: { code: 'code' },\n    __requestType: null as any,\n    __originalRequestType: null as any,\n    __responseType: null as any,\n    __originalResponseType: null as any,\n  };\n}\n\nexport function redeemGiftCard(): __PublicMethodMetaInfo<\n  'POST',\n  {},\n  ambassadorWixEcomV1GiftCardUniversalTypes.RedeemGiftCardRequest,\n  ambassadorWixEcomV1GiftCardTypes.RedeemGiftCardRequest,\n  ambassadorWixEcomV1GiftCardUniversalTypes.RedeemGiftCardResponse &\n    ambassadorWixEcomV1GiftCardUniversalTypes.RedeemGiftCardResponseNonNullableFields,\n  ambassadorWixEcomV1GiftCardTypes.RedeemGiftCardResponse &\n    ambassadorWixEcomV1GiftCardTypes.RedeemGiftCardResponseNonNullableFields\n> {\n  const payload = {} as any;\n\n  const getRequestOptions = ambassadorWixEcomV1GiftCard.redeemGiftCard(payload);\n\n  const getUrl = (context: any): string => {\n    const { url } = getRequestOptions(context);\n    return url!;\n  };\n\n  return {\n    getUrl,\n    httpMethod: 'POST',\n    path: '/v1/gift-cards/redeem',\n    pathParams: {},\n    __requestType: null as any,\n    __originalRequestType: null as any,\n    __responseType: null as any,\n    __originalResponseType: null as any,\n  };\n}\n\nexport function voidTransaction(): __PublicMethodMetaInfo<\n  'POST',\n  {},\n  ambassadorWixEcomV1GiftCardUniversalTypes.VoidTransactionRequest,\n  ambassadorWixEcomV1GiftCardTypes.VoidTransactionRequest,\n  ambassadorWixEcomV1GiftCardUniversalTypes.VoidTransactionResponse,\n  ambassadorWixEcomV1GiftCardTypes.VoidTransactionResponse\n> {\n  const payload = {} as any;\n\n  const getRequestOptions =\n    ambassadorWixEcomV1GiftCard.voidTransaction(payload);\n\n  const getUrl = (context: any): string => {\n    const { url } = getRequestOptions(context);\n    return url!;\n  };\n\n  return {\n    getUrl,\n    httpMethod: 'POST',\n    path: '/v1/gift-cards/void',\n    pathParams: {},\n    __requestType: null as any,\n    __originalRequestType: null as any,\n    __responseType: null as any,\n    __originalResponseType: null as any,\n  };\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,YAAY,SAA6C;AACvE,WAAS,cAAc,EAAE,KAAK,GAAQ;AACpC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAMO,SAAS,eAAe,SAA6C;AAC1E,WAAS,iBAAiB,EAAE,KAAK,GAAQ;AACvC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,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