{"version":3,"sources":["../../src/events-v2-policy-policies.public.ts","../../src/events-v2-policy-policies.universal.ts","../../src/events-v2-policy-policies.http.ts","../../src/events-v2-policy-policies.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  CreatePolicyApplicationErrors,\n  PoliciesQueryBuilder,\n  Policy,\n  PolicyCreatedEnvelope,\n  PolicyDeletedEnvelope,\n  PolicyQuery,\n  PolicyUpdatedEnvelope,\n  QueryPoliciesResponse,\n  ReorderEventPoliciesApplicationErrors,\n  ReorderEventPoliciesOptions,\n  ReorderEventPoliciesResponse,\n  UpdatePolicy,\n  createPolicy as universalCreatePolicy,\n  deletePolicy as universalDeletePolicy,\n  getPolicy as universalGetPolicy,\n  queryPolicies as universalQueryPolicies,\n  reorderEventPolicies as universalReorderEventPolicies,\n  typedQueryPolicies as universalTypedQueryPolicies,\n  updatePolicy as universalUpdatePolicy,\n} from './events-v2-policy-policies.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/events' };\n\nexport function createPolicy(httpClient: HttpClient): CreatePolicySignature {\n  return (policy: NonNullablePaths<Policy, `body` | `eventId` | `name`, 2>) =>\n    universalCreatePolicy(\n      policy,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CreatePolicySignature {\n  /**\n   * Creates a policy.\n   *\n   *\n   * <!--\n   * >  Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n   * -->\n   *\n   * The `createPolicy()` function returns a Promise that resolves to the newly-created policy.\n   *\n   * You can create up to 3 policies per event. If you try to create more than 3, you'll get the \"Maximum number of policies for the event has been reached\" error.\n   * @param - Policy info.\n   * @returns Created policy.\n   */\n  (policy: NonNullablePaths<Policy, `body` | `eventId` | `name`, 2>): Promise<\n    NonNullablePaths<Policy, `name` | `body` | `eventId`, 2> & {\n      __applicationErrorsType?: CreatePolicyApplicationErrors;\n    }\n  >;\n}\n\nexport function updatePolicy(httpClient: HttpClient): UpdatePolicySignature {\n  return (\n    _id: string,\n    policy: NonNullablePaths<\n      UpdatePolicy,\n      `body` | `eventId` | `name` | `revision`,\n      2\n    >\n  ) =>\n    universalUpdatePolicy(\n      _id,\n      policy,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface UpdatePolicySignature {\n  /**\n   * Updates a policy.\n   *\n   * <!--\n   * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n   * -->\n   *\n   * The `updatePolicy()` function returns a Promise that resolves to the newly-updated policy.\n   *\n   * Each time the policy is updated, `revision` increments by 1. The existing `revision` must be included when updating the policy. This ensures you're working with the latest policy and prevents unintended overwrites.\n   * @param - Policy to update.\n   * @param - Policy ID.\n   * @returns The updated policy.\n   */\n  (\n    _id: string,\n    policy: NonNullablePaths<\n      UpdatePolicy,\n      `body` | `eventId` | `name` | `revision`,\n      2\n    >\n  ): Promise<NonNullablePaths<Policy, `name` | `body` | `eventId`, 2>>;\n}\n\nexport function deletePolicy(httpClient: HttpClient): DeletePolicySignature {\n  return (policyId: string) =>\n    universalDeletePolicy(\n      policyId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface DeletePolicySignature {\n  /**\n   * Permanently deletes a policy.\n   *\n   *\n   * <!--\n   * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n   * -->\n   *\n   * The `deletePolicy()` function returns a Promise that resolves when the specified policy is deleted.\n   *\n   * Deleted policies are not returned by the `getPolicy()` or `queryPolicies()` functions.\n   * @param - Options for Delete Policy function.\n   * @param - ID of the policy to delete.\n   */\n  (policyId: string): Promise<void>;\n}\n\nexport function queryPolicies(httpClient: HttpClient): QueryPoliciesSignature {\n  return () =>\n    universalQueryPolicies(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface QueryPoliciesSignature {\n  /**\n   * Creates a query to retrieve a list of policies, given the provided paging and filter.\n   *\n   *\n   * The `queryPolicies()` function builds a query to retrieve a list of policies and returns a [PoliciesQueryBuilder](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder) object.\n   *\n   * The returned object contains the query definition which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/find) function.\n   *\n   * You can refine the query by chaining `PoliciesQueryBuilder` functions onto the query. `PoliciesQueryBuilder` functions enable you to sort, filter and control the results that `PoliciesQueryBuilder.find()` returns.\n   *\n   * The query runs with the following `PoliciesQueryBuilder` defaults that you can override:\n   *\n   * [`limit`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/limit): `50`\n   * [`descending`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/descending): `_createdDate`\n   *\n   * The functions that are chained to `queryPolicies()` are applied in the order they are called. For example, if you sort on the `_createdDate` property in ascending order and then on the id property in descending order, the results are sorted by the created date and then, if there are multiple results with the same date, the items are sorted by the id.\n   *\n   * The table below shows which `PoliciesQueryBuilder` functions are supported for `queryPoliciesGuests()`. You can only use one filter function for each property. If a property is used in more than one filter, only the first filter will work.\n   */\n  (): PoliciesQueryBuilder;\n}\n\nexport function typedQueryPolicies(\n  httpClient: HttpClient\n): TypedQueryPoliciesSignature {\n  return (query: PolicyQuery) =>\n    universalTypedQueryPolicies(\n      query,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface TypedQueryPoliciesSignature {\n  /** */\n  (query: PolicyQuery): Promise<\n    NonNullablePaths<\n      QueryPoliciesResponse,\n      | `policies`\n      | `policies.${number}.name`\n      | `policies.${number}.body`\n      | `policies.${number}.eventId`,\n      4\n    >\n  >;\n}\n\nexport function reorderEventPolicies(\n  httpClient: HttpClient\n): ReorderEventPoliciesSignature {\n  return (\n    policyId: string,\n    eventId: string,\n    options?: ReorderEventPoliciesOptions\n  ) =>\n    universalReorderEventPolicies(\n      policyId,\n      eventId,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface ReorderEventPoliciesSignature {\n  /**\n   * Changes policy order in an event dashboard and agreement checkbox on the checkout form.\n   * For example, if we have 3 policies in the list, after using this function the 3rd policy will become the 1st, and other policies will move by 1 position. By default, the policies are arranged by the created date in descending order.\n   *\n   * >  **Note**: it is possible to use both `beforePolicyId` and `afterPolicyId` at the same time but only the last one defined will be executed.\n   *\n   * <!--\n   * >  Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n   * -->\n   *\n   * The `reorderEventPolicies()` function returns a Promise that resolves to the newly-reordered policy.\n   * @param - Event policy ID.\n   * @param - Event ID.\n   * @param - Options for Reorder Event Policies function.\n   */\n  (\n    policyId: string,\n    eventId: string,\n    options?: ReorderEventPoliciesOptions\n  ): Promise<\n    NonNullablePaths<\n      ReorderEventPoliciesResponse,\n      | `policies`\n      | `policies.${number}.name`\n      | `policies.${number}.body`\n      | `policies.${number}.eventId`,\n      4\n    > & {\n      __applicationErrorsType?: ReorderEventPoliciesApplicationErrors;\n    }\n  >;\n}\n\nexport function getPolicy(httpClient: HttpClient): GetPolicySignature {\n  return (policyId: string) =>\n    universalGetPolicy(\n      policyId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetPolicySignature {\n  /**\n   * Retrieves a policy by ID.\n   *\n   *\n   * The `getPolicy()` function returns a Promise that resolves to a policy whose ID matches the given ID.\n   * @param - Policy ID.\n   * @returns The requested policy.\n   */\n  (policyId: string): Promise<\n    NonNullablePaths<Policy, `name` | `body` | `eventId`, 2>\n  >;\n}\n\nexport const onPolicyCreated = EventDefinition(\n  'wix.events.v2.policy_created',\n  true,\n  (event: PolicyCreatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n      ])\n    )\n)<PolicyCreatedEnvelope>();\nexport const onPolicyDeleted = EventDefinition(\n  'wix.events.v2.policy_deleted',\n  true,\n  (event: PolicyDeletedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n      ])\n    )\n)<PolicyDeletedEnvelope>();\nexport const onPolicyUpdated = EventDefinition(\n  'wix.events.v2.policy_updated',\n  true,\n  (event: PolicyUpdatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n      ])\n    )\n)<PolicyUpdatedEnvelope>();\n\nexport {\n  AccountInfo,\n  AccountInfoMetadata,\n  ActionEvent,\n  Address,\n  AddressLocation,\n  AddressStreetOneOf,\n  BaseEventMetadata,\n  CreatePolicyRequest,\n  CreatePolicyResponse,\n  CursorPaging,\n  Cursors,\n  DeletePolicyRequest,\n  DeletePolicyResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  Empty,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventCopied,\n  EventMetadata,\n  EventStatus,\n  GetPolicyRequest,\n  GetPolicyResponse,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  Location,\n  LocationType,\n  MapCoordinates,\n  MessageEnvelope,\n  Occurrence,\n  Paging,\n  PagingMetadataV2,\n  PoliciesQueryBuilder,\n  PoliciesQueryResult,\n  Policy,\n  PolicyCreatedEnvelope,\n  PolicyDeletedEnvelope,\n  PolicyQuerySpec,\n  PolicyUpdatedEnvelope,\n  QueryPoliciesRequest,\n  QueryPoliciesResponse,\n  QueryV2,\n  QueryV2PagingMethodOneOf,\n  Recurrences,\n  ReorderEventPoliciesOptions,\n  ReorderEventPoliciesOptionsReferencePolicyOneOf,\n  ReorderEventPoliciesRequest,\n  ReorderEventPoliciesRequestReferencePolicyOneOf,\n  ReorderEventPoliciesResponse,\n  RestoreInfo,\n  ScheduleConfig,\n  SortOrder,\n  Sorting,\n  Status,\n  StreetAddress,\n  Subdivision,\n  SubdivisionType,\n  UpdatePolicy,\n  UpdatePolicyRequest,\n  UpdatePolicyResponse,\n  UpdatePolicySortIndexRequest,\n  UpdatePolicySortIndexResponse,\n  WebhookIdentityType,\n  utils,\n} from './events-v2-policy-policies.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n  HttpClient,\n  HttpResponse,\n  NonNullablePaths,\n  QuerySpec,\n  Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixEventsV2Policy from './events-v2-policy-policies.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/**\n * A Policy is a set of terms and conditions attached to a specific event and shown during RSVP or checkout.\n *\n * You can use Policies to communicate refund, cancellation, and ticket-transfer rules by defining a policy name and body that attendees acknowledge.\n */\nexport interface Policy {\n  /**\n   * Policy ID.\n   * @format GUID\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * Revision number, which increments by 1 each time the policy is updated. The existing revision must be used when updating a policy to prevent conflicting changes. You'll get an error if you try to use the previous revision.\n   * @readonly\n   */\n  revision?: string | null;\n  /**\n   * Date and time when the policy was created.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /**\n   * Date and time of the policy's latest update in.\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n  /**\n   * Policy name that is visible in the dashboard and checkout form.\n   *\n   * Min: 1 character\n   *\n   * Max: 40 characters\n   * @minLength 1\n   * @maxLength 40\n   */\n  name?: string;\n  /**\n   * Policy body, usually containing various terms and conditions.\n   *\n   * Min: 1 character\n   *\n   * Max: 50000 characters.\n   *\n   * **Note**: You can format text using various HTML tags such as `<p>`, `<b>`, `<ul>`, etc.\n   * @minLength 1\n   * @maxLength 50000\n   */\n  body?: string;\n  /**\n   * ID of the event to which the policy belongs.\n   * @format GUID\n   * @immutable\n   */\n  eventId?: string;\n}\n\nexport interface CreatePolicyRequest {\n  /** Policy info. */\n  policy: Policy;\n}\n\nexport interface CreatePolicyResponse {\n  /** Created policy. */\n  policy?: Policy;\n}\n\nexport interface UpdatePolicyRequest {\n  /** Policy to update. */\n  policy: Policy;\n}\n\nexport interface UpdatePolicyResponse {\n  /** The updated policy. */\n  policy?: Policy;\n}\n\nexport interface UpdatePolicySortIndexRequest {\n  /**\n   * ID of the policy.\n   * @format GUID\n   */\n  policyId?: string;\n  /** The revision of the event policy. */\n  revision?: string;\n  /** The sort index of a policy to set. */\n  sortIndex?: number;\n}\n\nexport interface UpdatePolicySortIndexResponse {\n  /** The updated event policy. */\n  policy?: Policy;\n}\n\nexport interface DeletePolicyRequest {\n  /**\n   * ID of the policy to delete.\n   * @format GUID\n   */\n  policyId: string;\n}\n\nexport interface DeletePolicyResponse {}\n\nexport interface QueryPoliciesRequest {\n  /** Query options. See [API Query Langauge](https://dev.wix.com/api/rest/getting-started/api-query-language) for more details. */\n  query: QueryV2;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n  /** Pagination options. */\n  paging?: Paging;\n  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n  /** Filter object in the following format: <br/> `\"filter\" : { \"fieldName1\": \"value1\", \"fieldName2\":{\"$operator\":\"value2\"} }`. <br/> <br/> **Example:** <br/> `\"filter\" : { \"id\": \"2224a9d1-79e6-4549-a5c5-bf7ce5aac1a5\", \"revision\": {\"$ne\":\"1\"} }` <br/> <br/> See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information. */\n  filter?: Record<string, any> | null;\n  /** Sort object in the following format: <br/> `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]` <br/> <br/> **Example:** <br/> `[{\"fieldName\":\"createdDate\",\"direction\":\"DESC\"}]` <br/> <br/> See [supported fields](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information. */\n  sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n  /** Pagination options. */\n  paging?: Paging;\n  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n  /**\n   * Name of the field to sort by.\n   * @maxLength 100\n   */\n  fieldName?: string;\n  /** Sort order (ASC/DESC). Defaults to ASC */\n  order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n  ASC = 'ASC',\n  DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface Paging {\n  /** Number of items to load per page. */\n  limit?: number | null;\n  /** Number of items to skip in the current sort order. */\n  offset?: number | null;\n}\n\nexport interface CursorPaging {\n  /**\n   * Number of items to load per page.\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * Pointer to the next or previous page in the list of results.\n   * You can get the relevant cursor token\n   * from the `pagingMetadata` object in the previous call's response.\n   * Not relevant for the first request.\n   */\n  cursor?: string | null;\n}\n\nexport interface QueryPoliciesResponse {\n  /** Event policies. */\n  policies?: Policy[];\n  /** Query result's metadata. */\n  metadata?: PagingMetadataV2;\n}\n\nexport interface PagingMetadataV2 {\n  /** Number of items returned in the response. */\n  count?: number | null;\n  /** Offset that was requested. */\n  offset?: number | null;\n  /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */\n  total?: number | null;\n  /** Flag that indicates the server failed to calculate the `total` field. */\n  tooManyToCount?: boolean | null;\n  /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n  cursors?: Cursors;\n}\n\nexport interface Cursors {\n  /** Cursor pointing to next page in the list of results. */\n  next?: string | null;\n  /** Cursor pointing to previous page in the list of results. */\n  prev?: string | null;\n}\n\nexport interface ReorderEventPoliciesRequest\n  extends ReorderEventPoliciesRequestReferencePolicyOneOf {\n  /**\n   * Move the given `policyId` before the specified policy.\n   * @format GUID\n   */\n  beforePolicyId?: string;\n  /**\n   * Move the given `policyId` after the specified policy.\n   * @format GUID\n   */\n  afterPolicyId?: string;\n  /**\n   * Event ID.\n   * @format GUID\n   */\n  eventId: string;\n  /**\n   * Event policy ID.\n   * @format GUID\n   */\n  policyId: string;\n}\n\n/** @oneof */\nexport interface ReorderEventPoliciesRequestReferencePolicyOneOf {\n  /**\n   *\n   * @format GUID\n   */\n  beforePolicyId?: string;\n  /**\n   * Move the given `policyId` after the specified policy.\n   * @format GUID\n   */\n  afterPolicyId?: string;\n}\n\nexport interface ReorderEventPoliciesResponse {\n  /** Ordered event policies. */\n  policies?: Policy[];\n}\n\nexport interface GetPolicyRequest {\n  /**\n   * Policy ID.\n   * @format GUID\n   */\n  policyId: string;\n}\n\nexport interface GetPolicyResponse {\n  /** The requested policy. */\n  policy?: Policy;\n}\n\nexport interface EventCopied {\n  /** Event created timestamp in ISO UTC format. */\n  timestamp?: Date | null;\n  /**\n   * Event ID.\n   * @format GUID\n   */\n  eventId?: string;\n  /** Event location. */\n  location?: Location;\n  /** Event schedule configuration. */\n  scheduleConfig?: ScheduleConfig;\n  /** Event title. */\n  title?: string;\n  /**\n   * Event creator user ID.\n   * @format GUID\n   */\n  userId?: string | null;\n  /** Event status. */\n  status?: EventStatusWithLiterals;\n  /**\n   * Instance ID. Indicates the original app instance which current event was derived from.\n   * @format GUID\n   */\n  derivedFromInstanceId?: string | null;\n  /**\n   * Event ID. Indicates the original event which current event was derived from.\n   * @format GUID\n   */\n  derivedFromEventId?: string | null;\n  /**\n   * Map of copied ticket definitions from original event.\n   * Key represents ticket def id in the original event.\n   * Value represents ticket def id in the newly created event.\n   */\n  ticketDefinitions?: Record<string, string>;\n}\n\nexport interface Location {\n  /**\n   * Location name.\n   * @maxLength 50\n   */\n  name?: string | null;\n  /** Location map coordinates. */\n  coordinates?: MapCoordinates;\n  /**\n   * Single line address representation.\n   * @maxLength 300\n   */\n  address?: string | null;\n  /** Location type. */\n  type?: LocationTypeWithLiterals;\n  /**\n   * Full address derived from formatted single line `address`.\n   * When `full_address` is used to create or update the event, deprecated `address` and `coordinates` are ignored.\n   * If provided `full_address` has empty `formatted_address` or `coordinates`, it will be auto-completed using Atlas service.\n   *\n   * Migration notes:\n   * - `full_address.formatted_address` is equivalent to `address`.\n   * - `full_address.geocode` is equivalent to `coordinates`.\n   */\n  fullAddress?: Address;\n  /**\n   * Defines event location as TBD (To Be Determined).\n   * When event location is not yet defined, `name` is displayed instead of location address.\n   * `coordinates`, `address`, `type` and `full_address` are not required when location is TBD.\n   */\n  tbd?: boolean | null;\n}\n\nexport interface MapCoordinates {\n  /**\n   * Latitude.\n   * @min -90\n   * @max 90\n   */\n  lat?: number;\n  /**\n   * Longitude.\n   * @min -180\n   * @max 180\n   */\n  lng?: number;\n}\n\nexport enum LocationType {\n  VENUE = 'VENUE',\n  ONLINE = 'ONLINE',\n}\n\n/** @enumType */\nexport type LocationTypeWithLiterals = LocationType | 'VENUE' | 'ONLINE';\n\n/** Physical address */\nexport interface Address extends AddressStreetOneOf {\n  /** a break down of the street to number and street name */\n  streetAddress?: StreetAddress;\n  /** Main address line (usually street and number) as free text */\n  addressLine1?: string | null;\n  /**\n   * country code\n   * @format COUNTRY\n   */\n  country?: string | null;\n  /** subdivision (usually state or region) code according to ISO 3166-2 */\n  subdivision?: string | null;\n  /** city name */\n  city?: string | null;\n  /** zip/postal code */\n  postalCode?: string | null;\n  /** Free text providing more detailed address info. Usually contains Apt, Suite, Floor */\n  addressLine2?: string | null;\n  /** A string containing the human-readable address of this location */\n  formatted?: string | null;\n  /** Free text for human-to-human textual orientation aid purposes */\n  hint?: string | null;\n  /** coordinates of the physical address */\n  location?: AddressLocation;\n  /** country full-name */\n  countryFullname?: string | null;\n  /**\n   * multi-level subdivisions from top to bottom\n   * @maxSize 6\n   */\n  subdivisions?: Subdivision[];\n}\n\n/** @oneof */\nexport interface AddressStreetOneOf {\n  /** a break down of the street to number and street name */\n  streetAddress?: StreetAddress;\n  /** Main address line (usually street and number) as free text */\n  addressLine?: string | null;\n}\n\nexport interface StreetAddress {\n  /** street number */\n  number?: string;\n  /** street name */\n  name?: string;\n}\n\nexport interface AddressLocation {\n  /**\n   * address latitude coordinates\n   * @min -90\n   * @max 90\n   */\n  latitude?: number | null;\n  /**\n   * address longitude coordinates\n   * @min -180\n   * @max 180\n   */\n  longitude?: number | null;\n}\n\nexport interface Subdivision {\n  /** subdivision short code */\n  code?: string;\n  /** subdivision full-name */\n  name?: string;\n}\n\nexport enum SubdivisionType {\n  UNKNOWN_SUBDIVISION_TYPE = 'UNKNOWN_SUBDIVISION_TYPE',\n  /** State */\n  ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',\n  /** County */\n  ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',\n  /** City/town */\n  ADMINISTRATIVE_AREA_LEVEL_3 = 'ADMINISTRATIVE_AREA_LEVEL_3',\n  /** Neighborhood/quarter */\n  ADMINISTRATIVE_AREA_LEVEL_4 = 'ADMINISTRATIVE_AREA_LEVEL_4',\n  /** Street/block */\n  ADMINISTRATIVE_AREA_LEVEL_5 = 'ADMINISTRATIVE_AREA_LEVEL_5',\n  /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */\n  COUNTRY = 'COUNTRY',\n}\n\n/** @enumType */\nexport type SubdivisionTypeWithLiterals =\n  | SubdivisionType\n  | 'UNKNOWN_SUBDIVISION_TYPE'\n  | 'ADMINISTRATIVE_AREA_LEVEL_1'\n  | 'ADMINISTRATIVE_AREA_LEVEL_2'\n  | 'ADMINISTRATIVE_AREA_LEVEL_3'\n  | 'ADMINISTRATIVE_AREA_LEVEL_4'\n  | 'ADMINISTRATIVE_AREA_LEVEL_5'\n  | 'COUNTRY';\n\nexport interface ScheduleConfig {\n  /**\n   * Defines event as TBD (To Be Determined) schedule.\n   * When event time is not yet defined, TBD message is displayed instead of event start and end times.\n   * `startDate`, `endDate` and `timeZoneId` are not required when schedule is TBD.\n   */\n  scheduleTbd?: boolean;\n  /**\n   * TBD message.\n   * @maxLength 100\n   */\n  scheduleTbdMessage?: string | null;\n  /** Event start timestamp. */\n  startDate?: Date | null;\n  /** Event end timestamp. */\n  endDate?: Date | null;\n  /**\n   * Event time zone ID in TZ database format, e.g., `EST`, `America/Los_Angeles`.\n   * @maxLength 100\n   */\n  timeZoneId?: string | null;\n  /** Whether end date is hidden in the formatted schedule. */\n  endDateHidden?: boolean;\n  /** Whether time zone is displayed in formatted schedule. */\n  showTimeZone?: boolean;\n  /** Event recurrences. */\n  recurrences?: Recurrences;\n}\n\nexport interface Recurrences {\n  /**\n   * Event occurrences.\n   * @maxSize 1000\n   */\n  occurrences?: Occurrence[];\n  /**\n   * Recurring event category ID.\n   * @readonly\n   */\n  categoryId?: string | null;\n  /**\n   * Recurrence status.\n   * @readonly\n   */\n  status?: StatusWithLiterals;\n}\n\nexport interface Occurrence {\n  /** Event start timestamp. */\n  startDate?: Date | null;\n  /** Event end timestamp. */\n  endDate?: Date | null;\n  /**\n   * Event time zone ID in TZ database format, e.g., `EST`, `America/Los_Angeles`.\n   * @maxLength 100\n   */\n  timeZoneId?: string | null;\n  /** Whether time zone is displayed in formatted schedule. */\n  showTimeZone?: boolean;\n}\n\nexport enum Status {\n  /** Event occurs only once. */\n  ONE_TIME = 'ONE_TIME',\n  /** Event is recurring. */\n  RECURRING = 'RECURRING',\n  /** Marks the next upcoming occurrence of the recurring event. */\n  RECURRING_NEXT = 'RECURRING_NEXT',\n  /** Marks the most recent ended occurrence of the recurring event. */\n  RECURRING_LAST_ENDED = 'RECURRING_LAST_ENDED',\n  /** Marks the most recent canceled occurrence of the recurring event. */\n  RECURRING_LAST_CANCELED = 'RECURRING_LAST_CANCELED',\n}\n\n/** @enumType */\nexport type StatusWithLiterals =\n  | Status\n  | 'ONE_TIME'\n  | 'RECURRING'\n  | 'RECURRING_NEXT'\n  | 'RECURRING_LAST_ENDED'\n  | 'RECURRING_LAST_CANCELED';\n\nexport enum EventStatus {\n  /** Event is public and scheduled to start */\n  SCHEDULED = 'SCHEDULED',\n  /** Event has started */\n  STARTED = 'STARTED',\n  /** Event has ended */\n  ENDED = 'ENDED',\n  /** Event was canceled */\n  CANCELED = 'CANCELED',\n}\n\n/** @enumType */\nexport type EventStatusWithLiterals =\n  | EventStatus\n  | 'SCHEDULED'\n  | 'STARTED'\n  | 'ENDED'\n  | 'CANCELED';\n\nexport interface Empty {}\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  entity?: string;\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  currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted. */\n  deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n  body?: string;\n}\n\nexport interface MessageEnvelope {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\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?: WebhookIdentityTypeWithLiterals;\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\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n  | WebhookIdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface AccountInfo {\n  /**\n   * ID of the Wix account associated with the event.\n   * @format GUID\n   */\n  accountId?: string | null;\n  /**\n   * ID of the parent Wix account. Only included when accountId belongs to a child account.\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /**\n   * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n   * @format GUID\n   */\n  siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreatePolicyApplicationErrors = {\n  code?: 'POLICIES_LIMIT_REACHED';\n  description?: string;\n  data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type ReorderEventPoliciesApplicationErrors = {\n  code?: 'INVALID_REORDER_INSTRUCTION';\n  description?: string;\n  data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\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  accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n  /** ID of the Wix account associated with the event */\n  accountId: string;\n  /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n  siteId?: string;\n  /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n  parentAccountId?: string;\n}\n\nexport interface PolicyCreatedEnvelope {\n  entity: Policy;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a policy is created.\n * @permissionScope Manage Events - all permissions\n * @permissionScopeId SCOPE.DC-EVENTS-MEGA.MANAGE-EVENTS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Read Policies\n * @permissionScopeId SCOPE.DC-EVENTS.READ-POLICIES\n * @permissionScope Manage Policies\n * @permissionScopeId SCOPE.DC-EVENTS.MANAGE-POLICIES\n * @permissionId WIX_EVENTS.READ_POLICIES\n * @webhook\n * @eventType wix.events.v2.policy_created\n * @serviceIdentifier wix.events.v2.PolicyManagement\n * @slug created\n */\nexport declare function onPolicyCreated(\n  handler: (event: PolicyCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface PolicyDeletedEnvelope {\n  entity: Policy;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a policy is deleted.\n * @permissionScope Manage Events - all permissions\n * @permissionScopeId SCOPE.DC-EVENTS-MEGA.MANAGE-EVENTS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Read Policies\n * @permissionScopeId SCOPE.DC-EVENTS.READ-POLICIES\n * @permissionScope Manage Policies\n * @permissionScopeId SCOPE.DC-EVENTS.MANAGE-POLICIES\n * @permissionId WIX_EVENTS.READ_POLICIES\n * @webhook\n * @eventType wix.events.v2.policy_deleted\n * @serviceIdentifier wix.events.v2.PolicyManagement\n * @slug deleted\n */\nexport declare function onPolicyDeleted(\n  handler: (event: PolicyDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface PolicyUpdatedEnvelope {\n  entity: Policy;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a policy is updated.\n * @permissionScope Manage Events - all permissions\n * @permissionScopeId SCOPE.DC-EVENTS-MEGA.MANAGE-EVENTS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Read Policies\n * @permissionScopeId SCOPE.DC-EVENTS.READ-POLICIES\n * @permissionScope Manage Policies\n * @permissionScopeId SCOPE.DC-EVENTS.MANAGE-POLICIES\n * @permissionId WIX_EVENTS.READ_POLICIES\n * @webhook\n * @eventType wix.events.v2.policy_updated\n * @serviceIdentifier wix.events.v2.PolicyManagement\n * @slug updated\n */\nexport declare function onPolicyUpdated(\n  handler: (event: PolicyUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a policy.\n *\n *\n * <!--\n * >  Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n * -->\n *\n * The `createPolicy()` function returns a Promise that resolves to the newly-created policy.\n *\n * You can create up to 3 policies per event. If you try to create more than 3, you'll get the \"Maximum number of policies for the event has been reached\" error.\n * @public\n * @requiredField policy\n * @requiredField policy.body\n * @requiredField policy.eventId\n * @requiredField policy.name\n * @param policy - Policy info.\n * @permissionId WIX_EVENTS.MANAGE_POLICIES\n * @applicableIdentity APP\n * @returns Created policy.\n * @fqn wix.events.v2.PolicyManagement.CreatePolicy\n */\nexport async function createPolicy(\n  policy: NonNullablePaths<Policy, `body` | `eventId` | `name`, 2>\n): Promise<\n  NonNullablePaths<Policy, `name` | `body` | `eventId`, 2> & {\n    __applicationErrorsType?: CreatePolicyApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ policy: policy });\n\n  const reqOpts = ambassadorWixEventsV2Policy.createPolicy(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.policy!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { policy: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['policy']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Updates a policy.\n *\n * <!--\n * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n * -->\n *\n * The `updatePolicy()` function returns a Promise that resolves to the newly-updated policy.\n *\n * Each time the policy is updated, `revision` increments by 1. The existing `revision` must be included when updating the policy. This ensures you're working with the latest policy and prevents unintended overwrites.\n * @public\n * @requiredField _id\n * @requiredField policy\n * @requiredField policy.body\n * @requiredField policy.eventId\n * @requiredField policy.name\n * @requiredField policy.revision\n * @param policy - Policy to update.\n * @param _id - Policy ID.\n * @permissionId WIX_EVENTS.MANAGE_POLICIES\n * @applicableIdentity APP\n * @returns The updated policy.\n * @fqn wix.events.v2.PolicyManagement.UpdatePolicy\n */\nexport async function updatePolicy(\n  _id: string,\n  policy: NonNullablePaths<\n    UpdatePolicy,\n    `body` | `eventId` | `name` | `revision`,\n    2\n  >\n): Promise<NonNullablePaths<Policy, `name` | `body` | `eventId`, 2>> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    policy: { ...policy, id: _id },\n  });\n\n  const reqOpts = ambassadorWixEventsV2Policy.updatePolicy(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.policy!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: { policy: '$[1]' },\n        explicitPathsToArguments: { 'policy.id': '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['_id', 'policy']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface UpdatePolicy {\n  /**\n   * Policy ID.\n   * @format GUID\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * Revision number, which increments by 1 each time the policy is updated. The existing revision must be used when updating a policy to prevent conflicting changes. You'll get an error if you try to use the previous revision.\n   * @readonly\n   */\n  revision?: string | null;\n  /**\n   * Date policy was created.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /**\n   * Date and time of the policy's latest update in `yyyy-mm-ddThh:mm:sssZ` format.\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n  /**\n   * Policy name that is visible in the dashboard and checkout form.\n   *\n   * Min: 1 character\n   *\n   * Max: 40 characters\n   * @minLength 1\n   * @maxLength 40\n   */\n  name?: string;\n  /**\n   * Policy body. Here you can enter various terms and conditions.\n   *\n   * Min: 1 character\n   *\n   * Max: 50000 characters\n   *\n   * **Note**: You can format text using various HTML tags such as `<p>`, `<b>`, `<ul>`, etc.\n   * @minLength 1\n   * @maxLength 50000\n   */\n  body?: string;\n  /**\n   * ID of the event to which the policy belongs.\n   * @format GUID\n   * @immutable\n   */\n  eventId?: string;\n}\n\n/**\n * Permanently deletes a policy.\n *\n *\n * <!--\n * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n * -->\n *\n * The `deletePolicy()` function returns a Promise that resolves when the specified policy is deleted.\n *\n * Deleted policies are not returned by the `getPolicy()` or `queryPolicies()` functions.\n * @public\n * @requiredField policyId\n * @param options - Options for Delete Policy function.\n * @param policyId - ID of the policy to delete.\n * @permissionId WIX_EVENTS.MANAGE_POLICIES\n * @applicableIdentity APP\n * @fqn wix.events.v2.PolicyManagement.DeletePolicy\n */\nexport async function deletePolicy(policyId: string): Promise<void> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ policyId: policyId });\n\n  const reqOpts = ambassadorWixEventsV2Policy.deletePolicy(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { policyId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['policyId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Creates a query to retrieve a list of policies, given the provided paging and filter.\n *\n *\n * The `queryPolicies()` function builds a query to retrieve a list of policies and returns a [PoliciesQueryBuilder](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder) object.\n *\n * The returned object contains the query definition which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/find) function.\n *\n * You can refine the query by chaining `PoliciesQueryBuilder` functions onto the query. `PoliciesQueryBuilder` functions enable you to sort, filter and control the results that `PoliciesQueryBuilder.find()` returns.\n *\n * The query runs with the following `PoliciesQueryBuilder` defaults that you can override:\n *\n * [`limit`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/limit): `50`\n * [`descending`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/descending): `_createdDate`\n *\n * The functions that are chained to `queryPolicies()` are applied in the order they are called. For example, if you sort on the `_createdDate` property in ascending order and then on the id property in descending order, the results are sorted by the created date and then, if there are multiple results with the same date, the items are sorted by the id.\n *\n * The table below shows which `PoliciesQueryBuilder` functions are supported for `queryPoliciesGuests()`. You can only use one filter function for each property. If a property is used in more than one filter, only the first filter will work.\n * @public\n * @permissionId WIX_EVENTS.READ_POLICIES\n * @applicableIdentity APP\n * @fqn wix.events.v2.PolicyManagement.QueryPolicies\n */\nexport function queryPolicies(): PoliciesQueryBuilder {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  return queryBuilder<\n    Policy,\n    'CURSOR',\n    QueryPoliciesRequest,\n    QueryPoliciesResponse\n  >({\n    func: async (payload: QueryPoliciesRequest) => {\n      const reqOpts = ambassadorWixEventsV2Policy.queryPolicies(payload);\n\n      sideEffects?.onSiteCall?.();\n      try {\n        const result = await httpClient.request(reqOpts);\n        sideEffects?.onSuccess?.(result);\n        return result;\n      } catch (err) {\n        sideEffects?.onError?.(err);\n        throw err;\n      }\n    },\n    requestTransformer: (query: QueryPoliciesRequest['query']) => {\n      const args = [query, {}] as [QueryPoliciesRequest['query'], {}];\n      return renameKeysFromSDKRequestToRESTRequest({\n        ...args?.[1],\n        query: args?.[0],\n      });\n    },\n    responseTransformer: ({ data }: HttpResponse<QueryPoliciesResponse>) => {\n      const transformedData = renameKeysFromRESTResponseToSDKResponse(\n        transformPaths(data, [])\n      );\n\n      return {\n        items: transformedData?.policies,\n        pagingMetadata: transformedData?.metadata,\n      };\n    },\n    errorTransformer: (err: unknown) => {\n      const transformedError = sdkTransformError(err, {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      });\n\n      throw transformedError;\n    },\n    pagingMethod: 'CURSOR',\n    transformationPaths: {},\n  });\n}\n\ninterface QueryCursorResult {\n  cursors: Cursors;\n  hasNext: () => boolean;\n  hasPrev: () => boolean;\n  length: number;\n  pageSize: number;\n}\n\nexport interface PoliciesQueryResult extends QueryCursorResult {\n  items: Policy[];\n  query: PoliciesQueryBuilder;\n  next: () => Promise<PoliciesQueryResult>;\n  prev: () => Promise<PoliciesQueryResult>;\n}\n\nexport interface PoliciesQueryBuilder {\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  eq: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId',\n    value: any\n  ) => PoliciesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ne: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId',\n    value: any\n  ) => PoliciesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ge: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId',\n    value: any\n  ) => PoliciesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  gt: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId',\n    value: any\n  ) => PoliciesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  le: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId',\n    value: any\n  ) => PoliciesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  lt: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId',\n    value: any\n  ) => PoliciesQueryBuilder;\n  in: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId',\n    value: any\n  ) => PoliciesQueryBuilder;\n  exists: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId',\n    value: boolean\n  ) => PoliciesQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  ascending: (\n    ...propertyNames: Array<\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId'\n    >\n  ) => PoliciesQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  descending: (\n    ...propertyNames: Array<\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'name'\n      | 'body'\n      | 'eventId'\n    >\n  ) => PoliciesQueryBuilder;\n  /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n  limit: (limit: number) => PoliciesQueryBuilder;\n  /** @param cursor - A pointer to specific record */\n  skipTo: (cursor: string) => PoliciesQueryBuilder;\n  find: () => Promise<PoliciesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.events.v2.PolicyManagement.QueryPolicies\n * @requiredField query\n */\nexport async function typedQueryPolicies(\n  query: PolicyQuery\n): Promise<\n  NonNullablePaths<\n    QueryPoliciesResponse,\n    | `policies`\n    | `policies.${number}.name`\n    | `policies.${number}.body`\n    | `policies.${number}.eventId`,\n    4\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n  const reqOpts = ambassadorWixEventsV2Policy.queryPolicies(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['query']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface PolicyQuerySpec extends QuerySpec {\n  paging: 'cursor';\n  wql: [\n    {\n      fields: [\n        '_createdDate',\n        '_id',\n        '_updatedDate',\n        'body',\n        'eventId',\n        'name',\n        'revision'\n      ];\n      operators: [\n        '$eq',\n        '$exists',\n        '$gt',\n        '$gte',\n        '$in',\n        '$lt',\n        '$lte',\n        '$ne',\n        '$nin'\n      ];\n      sort: 'BOTH';\n    }\n  ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n  Policy,\n  PolicyQuerySpec\n>;\nexport type PolicyQuery = {\n  /** \n  Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  \n  */\n  cursorPaging?: {\n    /** \n  Number of items to load per page. \n  @max: 100 \n  */\n    limit?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n      | null;\n    /** \n  Pointer to the next or previous page in the list of results.\n  You can get the relevant cursor token\n  from the `pagingMetadata` object in the previous call's response.\n  Not relevant for the first request.  \n  */\n    cursor?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n      | null;\n  };\n  /** \n  Filter object in the following format: <br/> `\"filter\" : { \"fieldName1\": \"value1\", \"fieldName2\":{\"$operator\":\"value2\"} }`. <br/> <br/> **Example:** <br/> `\"filter\" : { \"id\": \"2224a9d1-79e6-4549-a5c5-bf7ce5aac1a5\", \"revision\": {\"$ne\":\"1\"} }` <br/> <br/> See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information.  \n  */\n  filter?: CommonQueryWithEntityContext['filter'] | null;\n  /** \n  Sort object in the following format: <br/> `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]` <br/> <br/> **Example:** <br/> `[{\"fieldName\":\"createdDate\",\"direction\":\"DESC\"}]` <br/> <br/> See [supported fields](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information.  \n  */\n  sort?: {\n    /** \n  Name of the field to sort by. \n  @maxLength: 100 \n  */\n    fieldName?: NonNullable<\n      CommonQueryWithEntityContext['sort']\n    >[number]['fieldName'];\n    /** \n  Sort order (ASC/DESC). Defaults to ASC  \n  */\n    order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n  }[];\n};\n\nexport const utils = {\n  query: {\n    ...createQueryUtils<Policy, PolicyQuerySpec, PolicyQuery>(),\n  },\n};\n\n/**\n * Changes policy order in an event dashboard and agreement checkbox on the checkout form.\n * For example, if we have 3 policies in the list, after using this function the 3rd policy will become the 1st, and other policies will move by 1 position. By default, the policies are arranged by the created date in descending order.\n *\n * >  **Note**: it is possible to use both `beforePolicyId` and `afterPolicyId` at the same time but only the last one defined will be executed.\n *\n * <!--\n * >  Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n * -->\n *\n * The `reorderEventPolicies()` function returns a Promise that resolves to the newly-reordered policy.\n * @param policyId - Event policy ID.\n * @param eventId - Event ID.\n * @public\n * @requiredField eventId\n * @requiredField policyId\n * @param options - Options for Reorder Event Policies function.\n * @permissionId WIX_EVENTS.MANAGE_POLICIES\n * @applicableIdentity APP\n * @fqn wix.events.v2.PolicyManagement.ReorderEventPolicies\n */\nexport async function reorderEventPolicies(\n  policyId: string,\n  eventId: string,\n  options?: ReorderEventPoliciesOptions\n): Promise<\n  NonNullablePaths<\n    ReorderEventPoliciesResponse,\n    | `policies`\n    | `policies.${number}.name`\n    | `policies.${number}.body`\n    | `policies.${number}.eventId`,\n    4\n  > & {\n    __applicationErrorsType?: ReorderEventPoliciesApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[3] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    policyId: policyId,\n    eventId: eventId,\n    beforePolicyId: options?.beforePolicyId,\n    afterPolicyId: options?.afterPolicyId,\n  });\n\n  const reqOpts = ambassadorWixEventsV2Policy.reorderEventPolicies(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          policyId: '$[0]',\n          eventId: '$[1]',\n          beforePolicyId: '$[2].beforePolicyId',\n          afterPolicyId: '$[2].afterPolicyId',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['policyId', 'eventId', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface ReorderEventPoliciesOptions\n  extends ReorderEventPoliciesOptionsReferencePolicyOneOf {\n  /**\n   * Move the given `policyId` before the specified policy.\n   * @format GUID\n   */\n  beforePolicyId?: string;\n  /**\n   * Move the given `policyId` after the specified policy.\n   * @format GUID\n   */\n  afterPolicyId?: string;\n}\n\n/** @oneof */\nexport interface ReorderEventPoliciesOptionsReferencePolicyOneOf {\n  /**\n   *\n   * @format GUID\n   */\n  beforePolicyId?: string;\n  /**\n   * Move the given `policyId` after the specified policy.\n   * @format GUID\n   */\n  afterPolicyId?: string;\n}\n\n/**\n * Retrieves a policy by ID.\n *\n *\n * The `getPolicy()` function returns a Promise that resolves to a policy whose ID matches the given ID.\n * @public\n * @requiredField policyId\n * @param policyId - Policy ID.\n * @permissionId WIX_EVENTS.READ_POLICIES\n * @applicableIdentity APP\n * @returns The requested policy.\n * @fqn wix.events.v2.PolicyManagement.GetPolicy\n */\nexport async function getPolicy(\n  policyId: string\n): Promise<NonNullablePaths<Policy, `name` | `body` | `eventId`, 2>> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ policyId: policyId });\n\n  const reqOpts = ambassadorWixEventsV2Policy.getPolicy(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.policy!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { policyId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['policyId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveWixEventsV2PolicyManagementUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    _: [\n      {\n        srcPath: '/_api/events-policies',\n        destPath: '',\n      },\n    ],\n    'api._api_base_domain_': [\n      {\n        srcPath: '/events-policies',\n        destPath: '',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/events-policies',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/events-policies',\n        destPath: '',\n      },\n      {\n        srcPath: '/events/v2/policies',\n        destPath: '/v2/policies',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/events-policies',\n        destPath: '',\n      },\n    ],\n    'editor.wixapps.net': [\n      {\n        srcPath: '/_api/events-policies',\n        destPath: '',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/events-policies',\n        destPath: '',\n      },\n    ],\n    'events.wixapps.net': [\n      {\n        srcPath: '/_api/events-policies',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_events_policies';\n\n/**\n * Creates a policy.\n *\n *\n * <!--\n * >  Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n * -->\n *\n * The `createPolicy()` function returns a Promise that resolves to the newly-created policy.\n *\n * You can create up to 3 policies per event. If you try to create more than 3, you'll get the \"Maximum number of policies for the event has been reached\" error.\n */\nexport function createPolicy(payload: object): RequestOptionsFactory<any> {\n  function __createPolicy({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [{ path: 'policy.createdDate' }, { path: 'policy.updatedDate' }],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.events.v2.policy',\n      method: 'POST' as any,\n      methodFqn: 'wix.events.v2.PolicyManagement.CreatePolicy',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixEventsV2PolicyManagementUrl({\n        protoPath: '/v2/policies',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'policy.createdDate' },\n              { path: 'policy.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __createPolicy;\n}\n\n/**\n * Updates a policy.\n *\n * <!--\n * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n * -->\n *\n * The `updatePolicy()` function returns a Promise that resolves to the newly-updated policy.\n *\n * Each time the policy is updated, `revision` increments by 1. The existing `revision` must be included when updating the policy. This ensures you're working with the latest policy and prevents unintended overwrites.\n */\nexport function updatePolicy(payload: object): RequestOptionsFactory<any> {\n  function __updatePolicy({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKFieldMaskToRESTFieldMask,\n        paths: [{ path: 'mask' }],\n      },\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [{ path: 'policy.createdDate' }, { path: 'policy.updatedDate' }],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.events.v2.policy',\n      method: 'PATCH' as any,\n      methodFqn: 'wix.events.v2.PolicyManagement.UpdatePolicy',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixEventsV2PolicyManagementUrl({\n        protoPath: '/v2/policies/{policy.id}',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'policy.createdDate' },\n              { path: 'policy.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __updatePolicy;\n}\n\n/**\n * Permanently deletes a policy.\n *\n *\n * <!--\n * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n * -->\n *\n * The `deletePolicy()` function returns a Promise that resolves when the specified policy is deleted.\n *\n * Deleted policies are not returned by the `getPolicy()` or `queryPolicies()` functions.\n */\nexport function deletePolicy(payload: object): RequestOptionsFactory<any> {\n  function __deletePolicy({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.events.v2.policy',\n      method: 'DELETE' as any,\n      methodFqn: 'wix.events.v2.PolicyManagement.DeletePolicy',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixEventsV2PolicyManagementUrl({\n        protoPath: '/v2/policies/{policyId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __deletePolicy;\n}\n\n/**\n * Creates a query to retrieve a list of policies, given the provided paging and filter.\n *\n *\n * The `queryPolicies()` function builds a query to retrieve a list of policies and returns a [PoliciesQueryBuilder](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder) object.\n *\n * The returned object contains the query definition which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/find) function.\n *\n * You can refine the query by chaining `PoliciesQueryBuilder` functions onto the query. `PoliciesQueryBuilder` functions enable you to sort, filter and control the results that `PoliciesQueryBuilder.find()` returns.\n *\n * The query runs with the following `PoliciesQueryBuilder` defaults that you can override:\n *\n * [`limit`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/limit): `50`\n * [`descending`](https://www.wix.com/velo/reference/wix-events-v2/policies/policiesquerybuilder/descending): `_createdDate`\n *\n * The functions that are chained to `queryPolicies()` are applied in the order they are called. For example, if you sort on the `_createdDate` property in ascending order and then on the id property in descending order, the results are sorted by the created date and then, if there are multiple results with the same date, the items are sorted by the id.\n *\n * The table below shows which `PoliciesQueryBuilder` functions are supported for `queryPoliciesGuests()`. You can only use one filter function for each property. If a property is used in more than one filter, only the first filter will work.\n */\nexport function queryPolicies(payload: object): RequestOptionsFactory<any> {\n  function __queryPolicies({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.events.v2.policy',\n      method: 'POST' as any,\n      methodFqn: 'wix.events.v2.PolicyManagement.QueryPolicies',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixEventsV2PolicyManagementUrl({\n        protoPath: '/v2/policies/query',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'policies.createdDate' },\n              { path: 'policies.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __queryPolicies;\n}\n\n/**\n * Changes policy order in an event dashboard and agreement checkbox on the checkout form.\n * For example, if we have 3 policies in the list, after using this function the 3rd policy will become the 1st, and other policies will move by 1 position. By default, the policies are arranged by the created date in descending order.\n *\n * >  **Note**: it is possible to use both `beforePolicyId` and `afterPolicyId` at the same time but only the last one defined will be executed.\n *\n * <!--\n * >  Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.\n * -->\n *\n * The `reorderEventPolicies()` function returns a Promise that resolves to the newly-reordered policy.\n */\nexport function reorderEventPolicies(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __reorderEventPolicies({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.events.v2.policy',\n      method: 'POST' as any,\n      methodFqn: 'wix.events.v2.PolicyManagement.ReorderEventPolicies',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixEventsV2PolicyManagementUrl({\n        protoPath: '/v2/policies/reorder',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'policies.createdDate' },\n              { path: 'policies.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __reorderEventPolicies;\n}\n\n/**\n * Retrieves a policy by ID.\n *\n *\n * The `getPolicy()` function returns a Promise that resolves to a policy whose ID matches the given ID.\n */\nexport function getPolicy(payload: object): RequestOptionsFactory<any> {\n  function __getPolicy({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.events.v2.policy',\n      method: 'GET' as any,\n      methodFqn: 'wix.events.v2.PolicyManagement.GetPolicy',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixEventsV2PolicyManagementUrl({\n        protoPath: '/v2/policies/{policyId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'policy.createdDate' },\n              { path: 'policy.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getPolicy;\n}\n","import {\n  createPolicy as publicCreatePolicy,\n  updatePolicy as publicUpdatePolicy,\n  deletePolicy as publicDeletePolicy,\n  queryPolicies as publicQueryPolicies,\n  typedQueryPolicies as publicTypedQueryPolicies,\n  reorderEventPolicies as publicReorderEventPolicies,\n  getPolicy as publicGetPolicy,\n} from './events-v2-policy-policies.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n  BuildRESTFunction,\n  MaybeContext,\n  BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n  PoliciesQueryBuilder,\n  PolicyQuery,\n  typedQueryPolicies as universalTypedQueryPolicies,\n} from './events-v2-policy-policies.universal.js';\nimport { onPolicyCreated as publicOnPolicyCreated } from './events-v2-policy-policies.public.js';\nimport { onPolicyDeleted as publicOnPolicyDeleted } from './events-v2-policy-policies.public.js';\nimport { onPolicyUpdated as publicOnPolicyUpdated } from './events-v2-policy-policies.public.js';\n\nfunction customQueryPolicies(httpClient: HttpClient) {\n  const router = createQueryOverloadRouter({\n    builderQueryFunction: () => publicQueryPolicies(httpClient)(),\n    typedQueryFunction: (query: PolicyQuery) =>\n      publicTypedQueryPolicies(httpClient)(query),\n    hasOptionsParameter: false,\n  });\n\n  function overloadedQuery(): PoliciesQueryBuilder;\n  function overloadedQuery(\n    query: PolicyQuery\n  ): ReturnType<typeof universalTypedQueryPolicies>;\n  function overloadedQuery(query?: PolicyQuery): any {\n    return router(...arguments);\n  }\n\n  return overloadedQuery;\n}\n\nexport const createPolicy: MaybeContext<\n  BuildRESTFunction<typeof publicCreatePolicy> & typeof publicCreatePolicy\n> = /*#__PURE__*/ createRESTModule(publicCreatePolicy);\nexport const updatePolicy: MaybeContext<\n  BuildRESTFunction<typeof publicUpdatePolicy> & typeof publicUpdatePolicy\n> = /*#__PURE__*/ createRESTModule(publicUpdatePolicy);\nexport const deletePolicy: MaybeContext<\n  BuildRESTFunction<typeof publicDeletePolicy> & typeof publicDeletePolicy\n> = /*#__PURE__*/ createRESTModule(publicDeletePolicy);\nexport const reorderEventPolicies: MaybeContext<\n  BuildRESTFunction<typeof publicReorderEventPolicies> &\n    typeof publicReorderEventPolicies\n> = /*#__PURE__*/ createRESTModule(publicReorderEventPolicies);\nexport const getPolicy: MaybeContext<\n  BuildRESTFunction<typeof publicGetPolicy> & typeof publicGetPolicy\n> = /*#__PURE__*/ createRESTModule(publicGetPolicy);\nexport const queryPolicies: MaybeContext<\n  BuildRESTFunction<typeof customQueryPolicies> & typeof customQueryPolicies\n> = /*#__PURE__*/ createRESTModule(customQueryPolicies);\n/**\n * Triggered when a policy is created.\n */\nexport const onPolicyCreated: BuildEventDefinition<\n  typeof publicOnPolicyCreated\n> &\n  typeof publicOnPolicyCreated = createEventModule(publicOnPolicyCreated);\n/**\n * Triggered when a policy is deleted.\n */\nexport const onPolicyDeleted: BuildEventDefinition<\n  typeof publicOnPolicyDeleted\n> &\n  typeof publicOnPolicyDeleted = createEventModule(publicOnPolicyDeleted);\n/**\n * Triggered when a policy is updated.\n */\nexport const onPolicyUpdated: BuildEventDefinition<\n  typeof publicOnPolicyUpdated\n> &\n  typeof publicOnPolicyUpdated = createEventModule(publicOnPolicyUpdated);\n\nexport {\n  SortOrder,\n  LocationType,\n  SubdivisionType,\n  Status,\n  EventStatus,\n  WebhookIdentityType,\n} from './events-v2-policy-policies.universal.js';\nexport {\n  Policy,\n  CreatePolicyRequest,\n  CreatePolicyResponse,\n  UpdatePolicyRequest,\n  UpdatePolicyResponse,\n  UpdatePolicySortIndexRequest,\n  UpdatePolicySortIndexResponse,\n  DeletePolicyRequest,\n  DeletePolicyResponse,\n  QueryPoliciesRequest,\n  QueryV2,\n  QueryV2PagingMethodOneOf,\n  Sorting,\n  Paging,\n  CursorPaging,\n  QueryPoliciesResponse,\n  PagingMetadataV2,\n  Cursors,\n  ReorderEventPoliciesRequest,\n  ReorderEventPoliciesRequestReferencePolicyOneOf,\n  ReorderEventPoliciesResponse,\n  GetPolicyRequest,\n  GetPolicyResponse,\n  EventCopied,\n  Location,\n  MapCoordinates,\n  Address,\n  AddressStreetOneOf,\n  StreetAddress,\n  AddressLocation,\n  Subdivision,\n  ScheduleConfig,\n  Recurrences,\n  Occurrence,\n  Empty,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  BaseEventMetadata,\n  EventMetadata,\n  AccountInfoMetadata,\n  PolicyCreatedEnvelope,\n  PolicyDeletedEnvelope,\n  PolicyUpdatedEnvelope,\n  UpdatePolicy,\n  PoliciesQueryResult,\n  PoliciesQueryBuilder,\n  PolicyQuerySpec,\n  ReorderEventPoliciesOptions,\n  ReorderEventPoliciesOptionsReferencePolicyOneOf,\n} from './events-v2-policy-policies.universal.js';\nexport { utils } from './events-v2-policy-policies.universal.js';\nexport {\n  SortOrderWithLiterals,\n  LocationTypeWithLiterals,\n  SubdivisionTypeWithLiterals,\n  StatusWithLiterals,\n  EventStatusWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n  CreatePolicyApplicationErrors,\n  ReorderEventPoliciesApplicationErrors,\n  CommonQueryWithEntityContext,\n  PolicyQuery,\n} from './events-v2-policy-policies.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAA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AO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,wBAGK,iCAAiBA,qBAA0B;AACtD,IAAMC,aAEK,iCAAiBA,UAAe;AAC3C,IAAMN,iBAEK,iCAAiB,mBAAmB;AAI/C,IAAMO,mBAGoB,kBAAkB,eAAqB;AAIjE,IAAMC,mBAGoB,kBAAkB,eAAqB;AAIjE,IAAMC,mBAGoB,kBAAkB,eAAqB;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTTimestampToSDKTimestamp","transformPaths","payload","transformPaths","SortOrder","LocationType","SubdivisionType","Status","EventStatus","WebhookIdentityType","createPolicy","updatePolicy","deletePolicy","queryPolicies","reorderEventPolicies","getPolicy","createPolicy","updatePolicy","deletePolicy","queryPolicies","typedQueryPolicies","reorderEventPolicies","getPolicy","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","queryPolicies","typedQueryPolicies","createPolicy","updatePolicy","deletePolicy","reorderEventPolicies","getPolicy","onPolicyCreated","onPolicyDeleted","onPolicyUpdated"]}