export interface Policy { /** * Policy ID. * @readonly */ id?: string | null; /** * Revision number, which increments by 1 each time the policy is updated. To prevent conflicting changes, the existing revision must be used when updating a policy. You'll get an error if you try to use the previous revision. * @readonly */ revision?: string | null; /** * Date and time when the policy was created in `yyyy-mm-ddThh:mm:sssZ` format. * @readonly */ createdDate?: Date | null; /** * Date and time of the policy's latest update in `yyyy-mm-ddThh:mm:sssZ` format. * @readonly */ updatedDate?: Date | null; name?: string; body?: string; /** ID of the event to which the policy belongs. */ eventId?: string; } export interface CreatePolicyRequest { /** Policy info. */ policy: Policy; } export interface CreatePolicyResponse { /** Created policy. */ policy?: Policy; } export interface UpdatePolicyRequest { /** Policy to update. */ policy: Policy; } export interface UpdatePolicyResponse { /** The updated policy. */ policy?: Policy; } export interface UpdatePolicySortIndexRequest { /** Policy's ID */ policyId?: string; /** The revision of the Event Policy */ revision?: string; /** the sort index of a policy to set */ sortIndex?: number; } export interface UpdatePolicySortIndexResponse { /** the updated Event Policy */ policy?: Policy; } export interface DeletePolicyRequest { /** ID of the policy to delete. */ policyId: string; } export interface DeletePolicyResponse { } export interface QueryPoliciesRequest { /** Query options. See [API Query Langauge](https://dev.wix.com/api/rest/getting-started/api-query-language) for more details. */ query: QueryV2; } export interface QueryV2 extends QueryV2PagingMethodOneOf { /** Pagination options. */ paging?: Paging; /** 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`. */ cursorPaging?: CursorPaging; /** Filter object in the following format:
`"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }`.

**Example:**
`"filter" : { "id": "2224a9d1-79e6-4549-a5c5-bf7ce5aac1a5", "revision": {"$ne":"1"} }`

See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information. */ filter?: Record | null; /** Sort object in the following format:
`[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`

**Example:**
`[{"fieldName":"createdDate","direction":"DESC"}]`

See [supported fields](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information. */ sort?: Sorting[]; } /** @oneof */ export interface QueryV2PagingMethodOneOf { /** Pagination options. */ paging?: Paging; /** 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`. */ cursorPaging?: CursorPaging; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order (ASC/DESC). Defaults to ASC */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface Paging { /** Number of items to load per page. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } export interface CursorPaging { /** Number of items to load per page. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * You can get the relevant cursor token * from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface QueryPoliciesResponse { /** List of policies. */ policies?: Policy[]; /** Metadata for the paginated results. */ metadata?: PagingMetadataV2; } export interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } export interface Cursors { /** Cursor pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } export interface ReorderEventPoliciesRequest extends ReorderEventPoliciesRequestReferencePolicyOneOf { /** Move the given `policyId` before the referenced policy. */ beforePolicyId?: string; /** Move the given `policyId` after the referenced policy. */ afterPolicyId?: string; /** Event ID. */ eventId: string; /** Policy ID. */ policyId: string; } /** @oneof */ export interface ReorderEventPoliciesRequestReferencePolicyOneOf { /** Move the given `policyId` before the referenced policy. */ beforePolicyId?: string; /** Move the given `policyId` after the referenced policy. */ afterPolicyId?: string; } export interface ReorderEventPoliciesResponse { /** Policies in the new order. */ policies?: Policy[]; } export interface GetPolicyRequest { /** Policy ID. */ policyId: string; } export interface GetPolicyResponse { /** The requested policy. */ policy?: Policy; } export interface EventCopied { /** Event created timestamp in ISO UTC format. */ timestamp?: Date | null; /** Event ID. */ eventId?: string; /** Event location. */ location?: Location; /** Event schedule configuration. */ scheduleConfig?: ScheduleConfig; /** Event title. */ title?: string; /** Event creator user ID. */ userId?: string | null; /** Event status. */ status?: EventStatus; /** Instance ID. Indicates the original app instance which current event was derived from. */ derivedFromInstanceId?: string | null; /** Event ID. Indicates the original event which current event was derived from. */ derivedFromEventId?: string | null; /** * Map of copied ticket definitions from original event. * Key represents ticket def id in the original event. * Value represents ticket def id in the newly created event. */ ticketDefinitions?: Record; } export interface Location { /** Location name. */ name?: string | null; /** Location map coordinates. */ coordinates?: MapCoordinates; /** Single line address representation. */ address?: string | null; /** Location type. */ type?: LocationType; /** * Full address derived from formatted single line `address`. * When `full_address` is used to create or update the event, deprecated `address` and `coordinates` are ignored. * If provided `full_address` has empty `formatted_address` or `coordinates`, it will be auto-completed using Atlas service. * * Migration notes: * - `full_address.formatted_address` is equivalent to `address`. * - `full_address.geocode` is equivalent to `coordinates`. */ fullAddress?: Address; /** * Defines event location as TBD (To Be Determined). * When event location is not yet defined, `name` is displayed instead of location address. * `coordinates`, `address`, `type` and `full_address` are not required when location is TBD. */ tbd?: boolean | null; } export interface MapCoordinates { /** Latitude. */ lat?: number; /** Longitude. */ lng?: number; } export declare enum LocationType { VENUE = "VENUE", ONLINE = "ONLINE" } /** Physical address */ export interface Address extends AddressStreetOneOf { /** a break down of the street to number and street name */ streetAddress?: StreetAddress; /** Main address line (usually street and number) as free text */ addressLine?: string | null; /** country code */ country?: string | null; /** subdivision (usually state or region) code according to ISO 3166-2 */ subdivision?: string | null; /** city name */ city?: string | null; /** zip/postal code */ postalCode?: string | null; /** Free text providing more detailed address info. Usually contains Apt, Suite, Floor */ addressLine2?: string | null; /** A string containing the human-readable address of this location */ formattedAddress?: string | null; /** Free text for human-to-human textual orientation aid purposes */ hint?: string | null; /** coordinates of the physical address */ geocode?: AddressLocation; /** country full-name */ countryFullname?: string | null; /** multi-level subdivisions from top to bottom */ subdivisions?: Subdivision[]; } /** @oneof */ export interface AddressStreetOneOf { /** a break down of the street to number and street name */ streetAddress?: StreetAddress; /** Main address line (usually street and number) as free text */ addressLine?: string | null; } export interface StreetAddress { /** street number */ number?: string; /** street name */ name?: string; } export interface AddressLocation { /** address latitude coordinates */ latitude?: number | null; /** address longitude coordinates */ longitude?: number | null; } export interface Subdivision { /** subdivision short code */ code?: string; /** subdivision full-name */ name?: string; } export declare enum SubdivisionType { UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE", /** State */ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1", /** County */ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2", /** City/town */ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3", /** Neighborhood/quarter */ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4", /** Street/block */ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5", /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */ COUNTRY = "COUNTRY" } export interface ScheduleConfig { /** * Defines event as TBD (To Be Determined) schedule. * When event time is not yet defined, TBD message is displayed instead of event start and end times. * `startDate`, `endDate` and `timeZoneId` are not required when schedule is TBD. */ scheduleTbd?: boolean; /** TBD message. */ scheduleTbdMessage?: string | null; /** Event start timestamp. */ startDate?: Date | null; /** Event end timestamp. */ endDate?: Date | null; /** Event time zone ID in TZ database format, e.g., `EST`, `America/Los_Angeles`. */ timeZoneId?: string | null; /** Whether end date is hidden in the formatted schedule. */ endDateHidden?: boolean; /** Whether time zone is displayed in formatted schedule. */ showTimeZone?: boolean; /** Event recurrences. */ recurrences?: Recurrences; } export interface Recurrences { /** Event occurrences. */ occurrences?: Occurrence[]; /** * Recurring event category ID. * @readonly */ categoryId?: string | null; /** * Recurrence status. * @readonly */ status?: Status; } export interface Occurrence { /** Event start timestamp. */ startDate?: Date | null; /** Event end timestamp. */ endDate?: Date | null; /** Event time zone ID in TZ database format, e.g., `EST`, `America/Los_Angeles`. */ timeZoneId?: string | null; /** Whether time zone is displayed in formatted schedule. */ showTimeZone?: boolean; } export declare enum Status { /** Event occurs only once. */ ONE_TIME = "ONE_TIME", /** Event is recurring. */ RECURRING = "RECURRING", /** Marks the next upcoming occurrence of the recurring event. */ RECURRING_NEXT = "RECURRING_NEXT", /** Marks the most recent ended occurrence of the recurring event. */ RECURRING_LAST_ENDED = "RECURRING_LAST_ENDED", /** Marks the most recent canceled occurrence of the recurring event. */ RECURRING_LAST_CANCELED = "RECURRING_LAST_CANCELED" } export declare enum EventStatus { /** Event is public and scheduled to start */ SCHEDULED = "SCHEDULED", /** Event has started */ STARTED = "STARTED", /** Event has ended */ ENDED = "ENDED", /** Event was canceled */ CANCELED = "CANCELED" } export interface Empty { } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } export interface RestoreInfo { deletedDate?: Date | null; } export interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntityAsJson?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntityAsJson?: string | null; } export interface ActionEvent { bodyAsJson?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface PolicyNonNullableFields { name: string; body: string; eventId: string; } export interface CreatePolicyResponseNonNullableFields { policy?: PolicyNonNullableFields; } export interface UpdatePolicyResponseNonNullableFields { policy?: PolicyNonNullableFields; } export interface QueryPoliciesResponseNonNullableFields { policies: PolicyNonNullableFields[]; } export interface ReorderEventPoliciesResponseNonNullableFields { policies: PolicyNonNullableFields[]; } export interface GetPolicyResponseNonNullableFields { policy?: PolicyNonNullableFields; } export {};