{"version":3,"sources":["../../src/bookings-policy-snapshots-v1-booking-policy-snapshot-booking-policy-snapshots.http.ts","../../src/bookings-policy-snapshots-v1-booking-policy-snapshot-booking-policy-snapshots.types.ts","../../src/bookings-policy-snapshots-v1-booking-policy-snapshot-booking-policy-snapshots.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\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\nfunction resolveComWixpressBookingsPolicySnapshotsV1BookingPolicySnapshotsUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/booking-policy-snapshots',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/booking-policy-snapshots',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/_api/booking-policy-snapshots',\n        destPath: '',\n      },\n      {\n        srcPath: '/booking-policy-snapshots',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_bookings_booking-policy-snapshots';\n\n/** Retrieves a list of booking policy snapshots by [booking IDs](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/about-the-bookings-apis). */\nexport function listPolicySnapshotsByBookingIds(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __listPolicySnapshotsByBookingIds({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.bookings.policy_snapshots.v1.booking_policy_snapshot',\n      method: 'GET' as any,\n      methodFqn:\n        'com.wixpress.bookings.policy.snapshots.v1.BookingPolicySnapshots.ListPolicySnapshotsByBookingIds',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressBookingsPolicySnapshotsV1BookingPolicySnapshotsUrl(\n        { protoPath: '/v1/policy-snapshots', data: payload, host }\n      ),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'bookingPolicySnapshots.createdDate' },\n              { path: 'bookingPolicySnapshots.policy.createdDate' },\n              { path: 'bookingPolicySnapshots.policy.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __listPolicySnapshotsByBookingIds;\n}\n","/**\n * The `bookingPolicySnapshot` object is the version of a service's booking policy\n * at the time a booking is created. This allows you for example to charge\n * customers the correct cancellation fee even after a service's cancellation\n * policy has been updated.\n */\nexport interface BookingPolicySnapshot {\n  /**\n   * Booking policy snapshot ID.\n   * @format GUID\n   * @readonly\n   */\n  id?: string | null;\n  /**\n   * ID of the booking that's associated with this policy snapshot.\n   * @format GUID\n   */\n  bookingId?: string | null;\n  /**\n   * Snapshot of the [booking policy](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction).\n   * at the time the corresponding booking was created.\n   */\n  policy?: BookingPolicy;\n  /**\n   * Date and time the booking policy snapshot was created in `YYYY-MM-DDThh:mm:ssZ` format.\n   * @readonly\n   */\n  createdDate?: Date | null;\n}\n\n/**\n * `BookingPolicy` is the main entity of `BookingPolicyService` and specifies a set of rules for booking a service\n * by visitors and members.\n *\n * Each `BookingPolicy` consists of a number of sub-policies. When the Bookings App is provisioned to a meta site then a\n * default `BookingPolicy` will be created with defaults for each of these sub-policies. This also applies when a request\n * is received to create a new `BookingPolicy` and one or more of these sub-policies are not provided.\n *\n * Sub-policies are defined in separate objects as specified below.\n * - The `CancellationPolicy` object defines the policy for canceling a booked session.\n * - The `ReschedulePolicy` object defines the policy for rescheduling booked session.\n *\n * By default each sub-policy is disabled. A more detailed specification of the default settings of each sub-policy\n * can be found in the description of the corresponding object.\n *\n * Partial updates are supported on the main entity level, however in order to update a sub-policy the client needs to provide the whole sub-policy object.\n */\nexport interface BookingPolicy {\n  /**\n   * Booking policy ID.\n   * @format GUID\n   * @readonly\n   */\n  id?: string | null;\n  /**\n   * Revision number, which increments by 1 each time the booking policy is updated. To prevent conflicting changes, the current `revision` must be passed when updating the booking policy.\n   * @readonly\n   */\n  revision?: string | null;\n  /**\n   * Date and time the booking policy was created.\n   * @readonly\n   */\n  createdDate?: Date | null;\n  /**\n   * Date and time the booking policy was updated.\n   * @readonly\n   */\n  updatedDate?: Date | null;\n  /**\n   * Name of the booking policy.\n   * @maxLength 400\n   */\n  name?: string | null;\n  /** Custom description for the booking policy and whether the booking policy is displayed to the participant. */\n  customPolicyDescription?: PolicyDescription;\n  /**\n   * Whether the booking policy is the default.\n   * @readonly\n   */\n  default?: boolean | null;\n  /** Rule for canceling a booking. */\n  cancellationPolicy?: CancellationPolicy;\n  /** Rule for rescheduling a booking. */\n  reschedulePolicy?: ReschedulePolicy;\n  /** Rules for cancellation fees. */\n  cancellationFeePolicy?: CancellationFeePolicy;\n  /** Rule for saving credit card details. */\n  saveCreditCardPolicy?: SaveCreditCardPolicy;\n}\n\n/** A description of the booking policy to display to participants. */\nexport interface PolicyDescription {\n  /**\n   * Whether the description is displayed to the participant. `true` means the\n   * description is displayed.\n   *\n   * Default: `false`\n   */\n  enabled?: boolean;\n  /**\n   * Description of the booking policy.\n   *\n   * Default: Empty\n   * Max length: 2500 characters\n   * @maxLength 2500\n   */\n  description?: string;\n  /**\n   * Description of the translated booking policy.\n   *\n   * Default: Empty\n   * Max length: 2500 characters\n   * @maxLength 2500\n   */\n  descriptionTranslated?: string | null;\n}\n\n/** The rule for canceling a booked session. */\nexport interface CancellationPolicy {\n  /**\n   * Whether customers can cancel the booking. `true` means customers can cancel\n   * the booking.\n   *\n   * Default: `false`\n   */\n  enabled?: boolean;\n  /**\n   * Whether there's a limit on the latest cancellation time. `false` means\n   * customers can cancel the booking until the last minute before the course or\n   * session starts.\n   *\n   * Default: `false`\n   */\n  limitLatestCancellation?: boolean;\n  /**\n   * Minimum number of minutes before the start of the session customers can cancel.\n   * For courses, this refers to the start of the first course session.\n   *\n   * Default: `1440` minutes (1 day)\n   * Min: `1` minute\n   * @min 1\n   */\n  latestCancellationInMinutes?: number;\n}\n\n/** The rule for rescheduling a booked session. */\nexport interface ReschedulePolicy {\n  /**\n   * Whether customers can reschedule a booking for an appointment-based service.\n   * `true` means customers can reschedule.\n   *\n   * Default: `false`\n   */\n  enabled?: boolean;\n  /**\n   * Whether there's a limit on the latest supported rescheduling time. `false`\n   * means customers can reschedule until the last minute before the session start.\n   *\n   * Default: `false`\n   */\n  limitLatestReschedule?: boolean;\n  /**\n   * Minimum number of minutes before the session start session customers can\n   * reschedule their booking.\n   *\n   * Default: `1440` minutes (1 day)\n   * Min: `1` minute\n   * @min 1\n   */\n  latestRescheduleInMinutes?: number;\n}\n\nexport interface CancellationFeePolicy {\n  /**\n   * Whether customers must pay a cancellation fee when canceling a booking.\n   *\n   * Default: `false`\n   */\n  enabled?: boolean;\n  /**\n   * Time windows relative to the session start during which customers can cancel\n   * their booking. Each window includes details about the fee for canceling\n   * within it.\n   * @maxSize 2\n   */\n  cancellationWindows?: CancellationWindow[];\n  /**\n   * Whether Wix automatically charges the cancellation fee from the customer once\n   * they cancel their booking.\n   *\n   * Default: `true`\n   */\n  autoCollectFeeEnabled?: boolean | null;\n}\n\n/**\n * Money.\n * Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.\n */\nexport interface Money {\n  /**\n   * Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gt:0, maxScale:2 }\n   */\n  value?: string;\n  /**\n   * Currency code. Must be valid ISO 4217 currency code (e.g., USD).\n   * @format CURRENCY\n   */\n  currency?: string;\n  /**\n   * Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative.\n   * @maxLength 50\n   */\n  formattedValue?: string | null;\n}\n\nexport interface CancellationWindow extends CancellationWindowFeeOneOf {\n  /** Fixed amount customers must pay when canceling the booking within this window. */\n  amount?: Money;\n  /**\n   * Percentage of the booking price customers must pay when canceling within this window.\n   *\n   * Min: `0.01` percent\n   * Max: `100` percent\n   * @decimalValue options { gt:0, lte:100, maxScale:2 }\n   */\n  percentage?: string;\n  /**\n   * Start of the cancellation window in minutes before the session start. For\n   * courses, this refers to the start of the first course session.\n   * @min 1\n   */\n  startInMinutes?: number | null;\n}\n\n/** @oneof */\nexport interface CancellationWindowFeeOneOf {\n  /** Fixed amount customers must pay when canceling the booking within this window. */\n  amount?: Money;\n  /**\n   * Percentage of the booking price customers must pay when canceling within this window.\n   *\n   * Min: `0.01` percent\n   * Max: `100` percent\n   * @decimalValue options { gt:0, lte:100, maxScale:2 }\n   */\n  percentage?: string;\n}\n\nexport interface SaveCreditCardPolicy {\n  /**\n   * Whether Wix stores credit card details of the customer. Storing the details\n   * allows Wix to prefill the checkout and thus increases the likelihood that the\n   * customer completes the booking process.\n   *\n   * Default: `false`\n   */\n  enabled?: boolean;\n}\n\n/** Policy for integrating with Intake form. Stores which form to use and when to present it. */\nexport interface IntakeFormPolicy {\n  /**\n   * Whether intake form integration is enabled for the service.\n   * Default: `false`\n   */\n  enabled?: boolean;\n  /**\n   * ID of the intake form to integrate with the service.\n   * @format GUID\n   */\n  formId?: string | null;\n  /** When to present the intake form to the customer. */\n  timing?: TimingWithLiterals;\n  completionRequirement?: CompletionRequirementWithLiterals;\n}\n\nexport enum Timing {\n  /** Send form after booking. */\n  AFTER_BOOKING = 'AFTER_BOOKING',\n  /** Show form during booking flow. */\n  BEFORE_BOOKING = 'BEFORE_BOOKING',\n}\n\n/** @enumType */\nexport type TimingWithLiterals = Timing | 'AFTER_BOOKING' | 'BEFORE_BOOKING';\n\n/** Requirement for completing the intake form. */\nexport enum CompletionRequirement {\n  /** Form completion is optional and can be skipped entirely. */\n  OPTIONAL = 'OPTIONAL',\n  /**\n   * Form must be completed before the booking can be finalized.\n   * can used only if timing is BEFORE_BOOKING.\n   */\n  REQUIRED_BEFORE_BOOKING = 'REQUIRED_BEFORE_BOOKING',\n}\n\n/** @enumType */\nexport type CompletionRequirementWithLiterals =\n  | CompletionRequirement\n  | 'OPTIONAL'\n  | 'REQUIRED_BEFORE_BOOKING';\n\nexport interface ListPolicySnapshotsByBookingIdsRequest {\n  /**\n   * List of booking IDs to retrieve policy snapshots for.\n   * @minSize 1\n   * @maxSize 100\n   * @format GUID\n   */\n  bookingIds: string[] | null;\n}\n\nexport interface ListPolicySnapshotsByBookingIdsResponse {\n  /** Retrieved booking policy snapshots. */\n  bookingPolicySnapshots?: BookingPolicySnapshot[];\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n  entityAsJson?: string;\n  /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */\n  restoreInfo?: RestoreInfo;\n}\n\nexport interface RestoreInfo {\n  deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n  /**\n   * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n   * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n   * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n   */\n  currentEntityAsJson?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted. */\n  deletedEntityAsJson?: string | null;\n}\n\nexport interface ActionEvent {\n  bodyAsJson?: string;\n}\n\nexport interface Empty {}\n\n/** @docsIgnore */\nexport type ListPolicySnapshotsByBookingIdsApplicationErrors = {\n  code?: 'BOOKING_POLICY_SNAPSHOT_NOT_FOUND';\n  description?: string;\n  data?: Record<string, any>;\n};\n","import * as ambassadorWixBookingsPolicySnapshotsV1BookingPolicySnapshot from './bookings-policy-snapshots-v1-booking-policy-snapshot-booking-policy-snapshots.http.js';\nimport * as ambassadorWixBookingsPolicySnapshotsV1BookingPolicySnapshotTypes from './bookings-policy-snapshots-v1-booking-policy-snapshot-booking-policy-snapshots.types.js';\nimport * as ambassadorWixBookingsPolicySnapshotsV1BookingPolicySnapshotUniversalTypes from './bookings-policy-snapshots-v1-booking-policy-snapshot-booking-policy-snapshots.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 listPolicySnapshotsByBookingIds(): __PublicMethodMetaInfo<\n  'GET',\n  {},\n  ambassadorWixBookingsPolicySnapshotsV1BookingPolicySnapshotUniversalTypes.ListPolicySnapshotsByBookingIdsRequest,\n  ambassadorWixBookingsPolicySnapshotsV1BookingPolicySnapshotTypes.ListPolicySnapshotsByBookingIdsRequest,\n  ambassadorWixBookingsPolicySnapshotsV1BookingPolicySnapshotUniversalTypes.ListPolicySnapshotsByBookingIdsResponse,\n  ambassadorWixBookingsPolicySnapshotsV1BookingPolicySnapshotTypes.ListPolicySnapshotsByBookingIdsResponse\n> {\n  const payload = {} as any;\n\n  const getRequestOptions =\n    ambassadorWixBookingsPolicySnapshotsV1BookingPolicySnapshot.listPolicySnapshotsByBookingIds(\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: 'GET',\n    path: '/v1/policy-snapshots',\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  BookingPolicySnapshot as BookingPolicySnapshotOriginal,\n  BookingPolicy as BookingPolicyOriginal,\n  PolicyDescription as PolicyDescriptionOriginal,\n  CancellationPolicy as CancellationPolicyOriginal,\n  ReschedulePolicy as ReschedulePolicyOriginal,\n  CancellationFeePolicy as CancellationFeePolicyOriginal,\n  Money as MoneyOriginal,\n  CancellationWindow as CancellationWindowOriginal,\n  CancellationWindowFeeOneOf as CancellationWindowFeeOneOfOriginal,\n  SaveCreditCardPolicy as SaveCreditCardPolicyOriginal,\n  IntakeFormPolicy as IntakeFormPolicyOriginal,\n  Timing as TimingOriginal,\n  TimingWithLiterals as TimingWithLiteralsOriginal,\n  CompletionRequirement as CompletionRequirementOriginal,\n  CompletionRequirementWithLiterals as CompletionRequirementWithLiteralsOriginal,\n  ListPolicySnapshotsByBookingIdsRequest as ListPolicySnapshotsByBookingIdsRequestOriginal,\n  ListPolicySnapshotsByBookingIdsResponse as ListPolicySnapshotsByBookingIdsResponseOriginal,\n  DomainEvent as DomainEventOriginal,\n  DomainEventBodyOneOf as DomainEventBodyOneOfOriginal,\n  EntityCreatedEvent as EntityCreatedEventOriginal,\n  RestoreInfo as RestoreInfoOriginal,\n  EntityUpdatedEvent as EntityUpdatedEventOriginal,\n  EntityDeletedEvent as EntityDeletedEventOriginal,\n  ActionEvent as ActionEventOriginal,\n  Empty as EmptyOriginal,\n  ListPolicySnapshotsByBookingIdsApplicationErrors as ListPolicySnapshotsByBookingIdsApplicationErrorsOriginal,\n} from './bookings-policy-snapshots-v1-booking-policy-snapshot-booking-policy-snapshots.types.js';\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,qEACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;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,gCACd,SAC4B;AAC5B,WAAS,kCAAkC,EAAE,KAAK,GAAQ;AACxD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK;AAAA,QACH,EAAE,WAAW,wBAAwB,MAAM,SAAS,KAAK;AAAA,MAC3D;AAAA,MACA,QAAQ,kBAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACA,aAClB,eAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,qCAAqC;AAAA,YAC7C,EAAE,MAAM,4CAA4C;AAAA,YACpD,EAAE,MAAM,4CAA4C;AAAA,UACtD;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC6MO,IAAK,SAAL,kBAAKC,YAAL;AAEL,EAAAA,QAAA,mBAAgB;AAEhB,EAAAA,QAAA,oBAAiB;AAJP,SAAAA;AAAA,GAAA;AAWL,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,cAAW;AAKX,EAAAA,uBAAA,6BAA0B;AAPhB,SAAAA;AAAA,GAAA;;;AC7QL,SAASC,mCAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACwD;AAAA,IAC1D;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","Timing","CompletionRequirement","listPolicySnapshotsByBookingIds"]}