import { NonNullablePaths } from '@wix/sdk-types'; /** Policy is the main entity of OrderPacingPolicies that can be used for lorem ipsum dolor */ interface Policy { /** * The policy's id * @format GUID */ _id?: string | null; /** * Current state of this policy. * Each time the policy is modified, its `revision` changes. * For an update operation to succeed, you MUST pass the latest revision */ revision?: string | null; /** The active state of this policy - is it enabled or not */ enabled?: boolean; /** * The location id this policy is related to * @format GUID */ locationId?: string | null; /** * The pacing rules this policy should enforce * @minSize 1 * @maxSize 1 */ rules?: PolicyRule[]; /** Extended fields. */ extendedFields?: ExtendedFields; } interface PolicyRule { /** * The volume limit * @min 1 */ volumeLimit?: number; /** Should the volume limit include contactless dine-in orders. */ includeContactlessDineinOrders?: boolean; /** * A list of weekly time intervals in which the policy should be enforced. * An empty list means that the enforcement times are during the opening hours of the restaurant. */ enforcementTimes?: WeeklyTimeInterval[]; } interface WeeklyTimeInterval { /** * The minute of the week the interval starts * @max 10080 */ minuteOfWeek?: number; /** * The duration in minutes of the interval, starting from the minute_of_week * @min 1 * @max 10080 */ durationInMinutes?: number; } interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } interface CreatePolicyRequest { /** The policy to be created */ policy: Policy; } interface CreatePolicyResponse { /** The created Policy */ policy?: Policy; } interface GetPolicyRequest { /** * The location_id the policy belongs to * @format GUID */ locationId?: string | null; } interface GetPolicyResponse { /** The retrieved Policy */ policy?: Policy; } interface UpdatePolicyRequest { /** Policy to be updated, may be partial */ policy: Policy; } interface UpdatePolicyResponse { /** The updated Policy */ policy?: Policy; } interface RestaurantLocationsUpdatedEvent { /** @format GUID */ metaSiteId?: string; triggerBy?: SyncLocationsSourceWithLiterals; prevLocationsProperties?: RestaurantLocationProperties[]; updatedLocationsProperties?: RestaurantLocationProperties[]; specialEvent?: SpecialEvent; } declare enum Type { UNKNOWN = "UNKNOWN", FROM_ZERO_LOCATIONS_TO_ONE_LOCATION = "FROM_ZERO_LOCATIONS_TO_ONE_LOCATION", FROM_ONE_LOCATION_TO_ZERO_LOCATIONS = "FROM_ONE_LOCATION_TO_ZERO_LOCATIONS" } /** @enumType */ type TypeWithLiterals = Type | 'UNKNOWN' | 'FROM_ZERO_LOCATIONS_TO_ONE_LOCATION' | 'FROM_ONE_LOCATION_TO_ZERO_LOCATIONS'; declare enum SyncLocationsSource { API = "API", LOCATION_EVENT = "LOCATION_EVENT", RESTAURANT_PROVISIONED_EVENT = "RESTAURANT_PROVISIONED_EVENT" } /** @enumType */ type SyncLocationsSourceWithLiterals = SyncLocationsSource | 'API' | 'LOCATION_EVENT' | 'RESTAURANT_PROVISIONED_EVENT'; interface RestaurantLocationProperties { locationId?: string; defaultLocation?: boolean; archived?: boolean; } interface SpecialEvent { type?: TypeWithLiterals; locationId?: string; } interface Empty { } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For 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 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. * 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. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } 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. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } interface EventMetadata extends BaseEventMetadata { /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For 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 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. * 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. */ entityEventSequence?: string | null; } interface PolicyCreatedEnvelope { entity: Policy; metadata: EventMetadata; } /** @webhook * @eventType wix.restaurants.order_pacing.v1.policy_created * @serviceIdentifier com.wixpress.restaurants.pacing.policies.OrderPacingPolicies * @slug created * @documentationMaturity preview */ declare function onPolicyCreated(handler: (event: PolicyCreatedEnvelope) => void | Promise): void; interface PolicyUpdatedEnvelope { entity: Policy; metadata: EventMetadata; } /** @webhook * @eventType wix.restaurants.order_pacing.v1.policy_updated * @serviceIdentifier com.wixpress.restaurants.pacing.policies.OrderPacingPolicies * @slug updated * @documentationMaturity preview */ declare function onPolicyUpdated(handler: (event: PolicyUpdatedEnvelope) => void | Promise): void; type PolicyNonNullablePaths = `enabled` | `rules` | `rules.${number}.volumeLimit` | `rules.${number}.includeContactlessDineinOrders`; /** * Creates a new Policy * The default location id for the metaSite will be used if the location_id is not provided * @param policy - The policy to be created * @public * @documentationMaturity preview * @requiredField policy * @requiredField policy.rules * @permissionId WIX_RESTAURANTS.ORDER_PACING_CREATE * @applicableIdentity APP * @returns The created Policy * @fqn com.wixpress.restaurants.pacing.policies.OrderPacingPolicies.CreatePolicy */ declare function createPolicy(policy: NonNullablePaths): Promise>; /** * Get a Policy by location_id * The default location id for the metaSite will be used if the location_id is not provided * @public * @documentationMaturity preview * @permissionId WIX_RESTAURANTS.ORDER_PACING_POLICIES_READ * @applicableIdentity APP * @fqn com.wixpress.restaurants.pacing.policies.OrderPacingPolicies.GetPolicy */ declare function getPolicy(options?: GetPolicyOptions): Promise>; interface GetPolicyOptions { /** * The location_id the policy belongs to * @format GUID */ locationId?: string | null; } /** * Update a Policy * The default location id for the metaSite will be used if the location_id is not provided * Pass the latest `revision` for a successful update * @param _id - The policy's id * @public * @documentationMaturity preview * @requiredField _id * @requiredField policy * @requiredField policy.revision * @requiredField policy.rules * @permissionId WIX_RESTAURANTS.ORDER_PACING_UPDATE * @applicableIdentity APP * @fqn com.wixpress.restaurants.pacing.policies.OrderPacingPolicies.UpdatePolicy */ declare function updatePolicy(_id: string, policy: NonNullablePaths): Promise>; interface UpdatePolicy { /** * The policy's id * @format GUID */ _id?: string | null; /** * Current state of this policy. * Each time the policy is modified, its `revision` changes. * For an update operation to succeed, you MUST pass the latest revision */ revision?: string | null; /** The active state of this policy - is it enabled or not */ enabled?: boolean; /** * The location id this policy is related to * @format GUID */ locationId?: string | null; /** * The pacing rules this policy should enforce * @minSize 1 * @maxSize 1 */ rules?: PolicyRule[]; /** Extended fields. */ extendedFields?: ExtendedFields; } export { type ActionEvent, type BaseEventMetadata, type CreatePolicyRequest, type CreatePolicyResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetPolicyOptions, type GetPolicyRequest, type GetPolicyResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type Policy, type PolicyCreatedEnvelope, type PolicyRule, type PolicyUpdatedEnvelope, type RestaurantLocationProperties, type RestaurantLocationsUpdatedEvent, type RestoreInfo, type SpecialEvent, SyncLocationsSource, type SyncLocationsSourceWithLiterals, Type, type TypeWithLiterals, type UpdatePolicy, type UpdatePolicyRequest, type UpdatePolicyResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type WeeklyTimeInterval, createPolicy, getPolicy, onPolicyCreated, onPolicyUpdated, updatePolicy };