{"version":3,"sources":["../../src/market-aim-v1-external-billing-event-external-billing.http.ts","../../src/market-aim-v1-external-billing-event-external-billing.types.ts","../../src/market-aim-v1-external-billing-event-external-billing.meta.ts"],"sourcesContent":["import { 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 { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nconst TRANSFORM_PATHS_0 = [{ path: 'event.createdDate' }];\n\nfunction resolveComWixpressMarketAimApiExternalBillingBiServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/app-instance-manager-webapp',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/apps',\n        destPath: '',\n      },\n    ],\n    'wixapis.com': [\n      {\n        srcPath: '/apps',\n        destPath: '',\n      },\n    ],\n    'dev._base_domain_': [\n      {\n        srcPath: '/_api/app-instance-manager',\n        destPath: '',\n      },\n      {\n        srcPath: '/api/v1/instance',\n        destPath: '/v1/instance',\n      },\n      {\n        srcPath: '/api/v1/scripts',\n        destPath: '/v1/scripts',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/app-instance-manager',\n        destPath: '',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/app-instance-manager',\n        destPath: '',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/app-instance-manager',\n        destPath: '',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/app-instance-manager',\n        destPath: '',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/app-instance-manager',\n        destPath: '',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/devcenter/app-instance/v1/instance',\n        destPath: '/v1/instance',\n      },\n      {\n        srcPath: '/devcenter/checkout/v1/checkout',\n        destPath: '/v1/checkout',\n      },\n      {\n        srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n        destPath: '/v1/metered-billing-charges',\n      },\n      {\n        srcPath: '/devcenter/scripts/v1/scripts',\n        destPath: '/v1/scripts',\n      },\n      {\n        srcPath: '/market/aim/v1/billing-event',\n        destPath: '/v1/billing-event',\n      },\n      {\n        srcPath: '/devcenter/bi-events/v1/bi-event',\n        destPath: '/v1/bi-event',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/devcenter/app-instance/v1/instance',\n        destPath: '/v1/instance',\n      },\n      {\n        srcPath: '/devcenter/checkout/v1/checkout',\n        destPath: '/v1/checkout',\n      },\n      {\n        srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n        destPath: '/v1/metered-billing-charges',\n      },\n      {\n        srcPath: '/devcenter/scripts/v1/scripts',\n        destPath: '/v1/scripts',\n      },\n      {\n        srcPath: '/market/aim/v1/billing-event',\n        destPath: '/v1/billing-event',\n      },\n      {\n        srcPath: '/devcenter/bi-events/v1/bi-event',\n        destPath: '/v1/bi-event',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_external-billing';\n\n/**\n * Sends an external billing event to Wix.\n * Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).\n * The reported event enables Wix to track revenue, deductions, and Wix's share related to Partner Billed App charges.\n */\nexport function reportExternalBillingEvent(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __reportExternalBillingEvent({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: TRANSFORM_PATHS_0,\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.market.aim.v1.external_billing_event',\n      method: 'POST' as any,\n      methodFqn:\n        'com.wixpress.market.aim.api.ExternalBillingBIService.ReportExternalBillingEvent',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressMarketAimApiExternalBillingBiServiceUrl({\n        protoPath: '/v1/billing-event',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: TRANSFORM_PATHS_0,\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __reportExternalBillingEvent;\n}\n","export interface ExternalBillingEvent {\n  /**\n   * The app ID linked to this transaction. This field is only relevant if using an API key for authorization,\n   * in which case you're required to pass the app ID.\n   * @format GUID\n   */\n  appId?: string | null;\n  /**\n   * The app instance ID linked to this transaction. This field is only relevant if using an API key for authorization,\n   * in which case you can optionally pass the instance ID.\n   *\n   * This connects the transaction to a specific instance of your app installed on a Wix site.\n   * Learn more [about app instances](https://dev.wix.com/docs/build-apps/develop-your-app/access/app-instances/about-app-instances).\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * The total amount of the transaction in USD, not including tax.\n   * This value can be negative for refunds or adjustments.\n   *\n   * Example: \"120.50\" for a $120.50 charge, or \"-120.50\" for a $120.50 refund.\n   * @format DECIMAL_VALUE\n   * @decimalValue options { maxScale:10 }\n   */\n  grossRevenue?: string;\n  /**\n   * The amount charged in USD minus agreed-upon expenses, such as shipping fees or\n   * payment processing fees. Wix subtracts its share from this amount.\n   * The value can be negative for refunds.\n   *\n   * Example calculation:\n   * - Gross revenue: $120.50\n   * - Minus expenses: $20.00 (shipping)\n   * - Net revenue: $100.50\n   * @format DECIMAL_VALUE\n   * @decimalValue options { maxScale:10 }\n   */\n  netRevenue?: string | null;\n  /**\n   * Wix's share of the transaction in USD, taken from the net revenue.\n   * This value can be negative, such as for adjustments or refunds.\n   *\n   * Calculate based on your Partner Agreement terms. For example, if Wix's share is 20%:\n   * - Net revenue: $100.50\n   * - Wix share (20%): $20.10\n   *\n   * Important: Update this value if your revenue share percentage changes.\n   * @format DECIMAL_VALUE\n   * @decimalValue options { maxScale:10 }\n   */\n  wixShare?: string;\n  /** The date and time of the transaction. */\n  createdDate?: Date | null;\n  /** The type of billing event, either charge or refund. */\n  billingType?: BillingTypeWithLiterals;\n}\n\nexport enum BillingType {\n  UNKNOWN = 'UNKNOWN',\n  CHARGE = 'CHARGE',\n  REFUND = 'REFUND',\n}\n\n/** @enumType */\nexport type BillingTypeWithLiterals =\n  | BillingType\n  | 'UNKNOWN'\n  | 'CHARGE'\n  | 'REFUND';\n\nexport interface ReportExternalBillingEventRequest {\n  /**\n   * The billing event with details of the external transaction, including the gross revenue,\n   * net revenue, and billing type (charge or refund).\n   */\n  event?: ExternalBillingEvent;\n}\n\nexport interface ReportExternalBillingEventResponse {\n  /** The billing event that was processed. */\n  event?: ExternalBillingEvent;\n}\n\n/** @docsIgnore */\nexport type ReportExternalBillingEventApplicationErrors = {\n  code?: 'FAILED_PRECONDITION';\n  description?: string;\n  data?: Record<string, any>;\n};\n","import * as ambassadorWixMarketAimV1ExternalBillingEvent from './market-aim-v1-external-billing-event-external-billing.http.js';\nimport * as ambassadorWixMarketAimV1ExternalBillingEventTypes from './market-aim-v1-external-billing-event-external-billing.types.js';\nimport * as ambassadorWixMarketAimV1ExternalBillingEventUniversalTypes from './market-aim-v1-external-billing-event-external-billing.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 reportExternalBillingEvent(): __PublicMethodMetaInfo<\n  'POST',\n  {},\n  ambassadorWixMarketAimV1ExternalBillingEventUniversalTypes.ReportExternalBillingEventRequest,\n  ambassadorWixMarketAimV1ExternalBillingEventTypes.ReportExternalBillingEventRequest,\n  ambassadorWixMarketAimV1ExternalBillingEventUniversalTypes.ReportExternalBillingEventResponse,\n  ambassadorWixMarketAimV1ExternalBillingEventTypes.ReportExternalBillingEventResponse\n> {\n  const payload = {} as any;\n\n  const getRequestOptions =\n    ambassadorWixMarketAimV1ExternalBillingEvent.reportExternalBillingEvent(\n      payload\n    );\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/billing-event',\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 {\n  ExternalBillingEvent as ExternalBillingEventOriginal,\n  BillingType as BillingTypeOriginal,\n  BillingTypeWithLiterals as BillingTypeWithLiteralsOriginal,\n  ReportExternalBillingEventRequest as ReportExternalBillingEventRequestOriginal,\n  ReportExternalBillingEventResponse as ReportExternalBillingEventResponseOriginal,\n  ReportExternalBillingEventApplicationErrors as ReportExternalBillingEventApplicationErrorsOriginal,\n} from './market-aim-v1-external-billing-event-external-billing.types.js';\n"],"mappings":";AAAA,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,IAAM,oBAAoB,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAExD,SAAS,0DACP,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,eAAe;AAAA,MACb;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,I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