import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; interface Variant { /** * Item variant ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the item variant is updated. To prevent conflicting changes, the current revision must be passed when updating the item variant. Ignored when creating an item variant. * @readonly */ revision?: string | null; /** * Date and time the item variant was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the item variant was updated. * @readonly */ _updatedDate?: Date | null; /** * Item variant name. * @minLength 1 * @maxLength 200 */ name?: string | null; /** Extended fields. */ extendedFields?: ExtendedFields; /** * IDs of the business locations ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations)) where these item variants are available. * @maxSize 100 * @format GUID * @readonly */ businessLocationIds?: string[]; } 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 ExternalReferenceInfo { /** * ID of the external integrator app\system associated with this object. * @format GUID */ externalAppId?: string | null; /** * Reference to an external resource ID. Used to link this object to a specific entity in an external system. * @maxLength 100 */ externalEntityId?: string | null; /** Last time this item variant was synced with the external app. */ lastSyncDate?: Date | null; /** Whether the connection to the external system is currently active. */ connected?: boolean | null; } interface InvalidateCache extends InvalidateCacheGetByOneOf { /** * Invalidate by msId. NOT recommended, as this will invalidate the entire site cache! * @format GUID */ metaSiteId?: string; /** * Invalidate by Site ID. NOT recommended, as this will invalidate the entire site cache! * @format GUID */ siteId?: string; /** Invalidate by App */ app?: App; /** Invalidate by page id */ page?: Page; /** Invalidate by URI path */ uri?: URI; /** Invalidate by file (for media files such as PDFs) */ file?: File; /** Invalidate by custom tag. Tags used in BO invalidation are disabled for this endpoint (more info: https://wix-bo.com/dev/clear-ssr-cache) */ customTag?: CustomTag; /** Invalidate by multiple page ids */ pages?: Pages; /** Invalidate by multiple URI paths */ uris?: URIs; /** * tell us why you're invalidating the cache. You don't need to add your app name * @maxLength 256 */ reason?: string | null; /** Is local DS */ localDc?: boolean; hardPurge?: boolean; /** * Optional caller-provided ID for tracking this invalidation through the system. * When set, the corresponding CDN purge completion event will include this ID, * allowing you to confirm when the invalidation has fully propagated. * Example: generate a UUID, pass it here, and later match it in the CDN purge completion event. * @maxLength 256 */ correlationId?: string | null; } /** @oneof */ interface InvalidateCacheGetByOneOf { /** * Invalidate by msId. NOT recommended, as this will invalidate the entire site cache! * @format GUID */ metaSiteId?: string; /** * Invalidate by Site ID. NOT recommended, as this will invalidate the entire site cache! * @format GUID */ siteId?: string; /** Invalidate by App */ app?: App; /** Invalidate by page id */ page?: Page; /** Invalidate by URI path */ uri?: URI; /** Invalidate by file (for media files such as PDFs) */ file?: File; /** Invalidate by custom tag. Tags used in BO invalidation are disabled for this endpoint (more info: https://wix-bo.com/dev/clear-ssr-cache) */ customTag?: CustomTag; /** Invalidate by multiple page ids */ pages?: Pages; /** Invalidate by multiple URI paths */ uris?: URIs; } interface App { /** * The AppDefId * @minLength 1 */ appDefId?: string; /** * The instance Id * @format GUID */ instanceId?: string; } interface Page { /** * the msid the page is on * @format GUID */ metaSiteId?: string; /** * Invalidate by Page ID * @minLength 1 */ pageId?: string; } interface URI { /** * the msid the URI is on * @format GUID */ metaSiteId?: string; /** * URI path to invalidate (e.g. page/my/path) - without leading/trailing slashes * @minLength 1 */ uriPath?: string; } interface File { /** * the msid the file is related to * @format GUID */ metaSiteId?: string; /** * Invalidate by filename (for media files such as PDFs) * @minLength 1 * @maxLength 256 */ fileName?: string; } interface CustomTag { /** * the msid the tag is related to * @format GUID */ metaSiteId?: string; /** * Tag to invalidate by * @minLength 1 * @maxLength 256 */ tag?: string; } interface Pages { /** * the msid the pages are on * @format GUID */ metaSiteId?: string; /** * Invalidate by multiple Page IDs in a single message * @maxSize 100 * @minLength 1 */ pageIds?: string[]; } interface URIs { /** * the msid the URIs are on * @format GUID */ metaSiteId?: string; /** * URI paths to invalidate (e.g. page/my/path) - without leading/trailing slashes * @maxSize 100 * @minLength 1 */ uriPaths?: string[]; } interface CreateVariantRequest { /** Item variant info. */ variant: Variant; } interface CreateVariantResponse { /** Item variant. */ variant?: Variant; } interface GetVariantRequest { /** * ID of the item variant to retrieve. * @format GUID */ variantId: string; } interface GetVariantResponse { /** Item variant. */ variant?: Variant; } interface ListVariantsRequest { /** * Item variant IDs. * @format GUID * @maxSize 500 */ variantIds?: string[]; /** The metadata of the paginated results. */ paging?: CursorPaging; } interface CursorPaging { /** * Number of items to load. * @max 500 */ 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. * @maxLength 16000 */ cursor?: string | null; } interface ListVariantsResponse { /** The retrieved item variants. */ variants?: Variant[]; /** The metadata of the paginated results. */ metadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ cursors?: Cursors; /** * Indicates if there are more results after the current page. * If `true`, another page of results can be retrieved. * If `false`, this is the last page. */ hasNext?: boolean | null; } interface Cursors { /** * Cursor pointing to next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface UpdateVariantRequest { /** Item variant to update. */ variant: Variant; } interface UpdateVariantResponse { /** Updated item variant. */ variant?: Variant; } interface BulkCreateVariantsRequest { /** * Item variants details. * @maxSize 100 */ variants: Variant[]; /** Whether to receive the created item variants in the response. */ returnEntity?: boolean; } interface BulkCreateVariantsResponse { /** Information about the created item variants. */ results?: BulkVariantResult[]; /** Metadata for the API call. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkVariantResult { /** Metadata for creation of item variants. */ itemMetadata?: ItemMetadata; /** Created item variants. Only returned if the `returnEntity` value is `true`. */ variant?: Variant; } interface ItemMetadata { /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */ _id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } interface BulkUpdateVariantsRequest { /** * Item variants to be updated. * @minSize 1 * @maxSize 100 */ variants: MaskedVariant[]; /** Whether to receive the updated item variants in the response. */ returnEntity?: boolean; } interface MaskedVariant { /** Item variant to update. */ variant?: Variant; } interface BulkUpdateVariantsResponse { /** * Information about the updated item variants. * @minSize 1 * @maxSize 100 */ results?: BulkVariantResult[]; /** Metadata for the API call. */ bulkActionMetadata?: BulkActionMetadata; } interface DeleteVariantRequest { /** * Item variant ID. * @format GUID */ variantId: string; } interface DeleteVariantResponse { } interface QueryVariantsRequest { /** Query options. */ query?: CursorQuery; } interface CursorQuery extends CursorQueryPagingMethodOneOf { /** 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 of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` * @maxSize 4 */ sort?: Sorting[]; } /** @oneof */ interface CursorQueryPagingMethodOneOf { /** 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; } interface Sorting { /** * Name of the field to sort by. * @maxLength 64 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface QueryVariantsResponse { /** Retrieved item variants. */ variants?: Variant[]; /** Metadata of the paginated results. */ pagingMetadata?: CursorPagingMetadata; } interface CountVariantsRequest { /** Filter for counting variants. */ filter?: Record | null; } interface CountVariantsResponse { /** Counted variants. */ count?: number; } interface CloneVariantsRequest { /** * The MetaSiteId to clone from * @format GUID */ metaSiteId?: string; } interface CloneVariantsResponse { } interface BulkDeleteVariantsRequest { /** * Item variant IDs. * @format GUID * @maxSize 200 */ ids: string[]; } interface BulkDeleteVariantsResponse { /** Information about the deleted variants. */ results?: BulkDeleteVariantsResult[]; /** Metadata for the API call. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkDeleteVariantsResult { /** Metadata for variants deletion. */ itemMetadata?: ItemMetadata; } interface BulkUpdateBusinessLocationIdsRequest { /** * variant ids * @format GUID * @minSize 1 * @maxSize 100 */ variantIds?: string[]; /** * Business Location Ids. * @maxSize 100 * @format GUID */ businessLocationIds?: string[]; } interface BulkUpdateBusinessLocationIdsResponse { /** * Information about the updated variants. * @minSize 1 * @maxSize 100 */ results?: BulkUpdateBusinessLocationIdsResponseBulkItemResult[]; } interface BulkUpdateBusinessLocationIdsResponseBulkItemResult { /** Metadata for item update. */ itemMetadata?: ItemMetadata; } interface BulkUpdateBusinessLocationIdsPerEntityRequest { /** * @minSize 1 * @maxSize 100 */ variantIdLocationIds?: VariantIdLocationIds[]; } interface VariantIdLocationIds { /** * variant ID * @format GUID */ variantId?: string; /** * Business Location IDs * @maxSize 100 * @format GUID */ businessLocationIds?: string[]; } interface BulkUpdateBusinessLocationIdsPerEntityResponse { /** * Information about the updated variants. * @minSize 1 * @maxSize 100 */ results?: BulkUpdateBusinessLocationIdsPerEntityResponseBulkItemResult[]; } interface BulkUpdateBusinessLocationIdsPerEntityResponseBulkItemResult { /** Metadata for item update. */ itemMetadata?: ItemMetadata; } interface BulkUpdateAttachedToOrphanItemRequest { /** * @minSize 1 * @maxSize 100 */ variantIdAttachedToOrphanItem?: VariantIdAttachedToOrphanItem[]; } interface VariantIdAttachedToOrphanItem { /** * variant ID * @format GUID */ variantId?: string; /** Attached to orphan item */ attachedToOrphanItem?: boolean; } interface BulkUpdateAttachedToOrphanItemResponse { /** * Information about the updated variants. * @minSize 1 * @maxSize 100 */ results?: BulkItemResult[]; } interface BulkItemResult { /** Metadata for item update. */ itemMetadata?: ItemMetadata; } 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 Empty { } interface SyncContentToMultilingualRequest { /** * MetaSite ID * @format GUID */ metaSiteId?: string; } interface SyncContentToMultilingualResponse { } 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; /** Details related to the account */ accountInfo?: AccountInfo; } 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 AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } /** @docsIgnore */ type CountVariantsApplicationErrors = { code?: 'TOO_MANY_TO_COUNT'; description?: string; data?: Record; }; interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } 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; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface ItemVariantCreatedEnvelope { entity: Variant; metadata: EventMetadata; } /** @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionId RESTAURANTS.VARIANT_READ * @webhook * @eventType wix.restaurants.menus.v1.item_variant_created * @serviceIdentifier wix.restaurants.menus_item_variant.v1.VariantsService * @slug created * @documentationMaturity preview */ declare function onItemVariantCreated(handler: (event: ItemVariantCreatedEnvelope) => void | Promise): void; interface ItemVariantDeletedEnvelope { metadata: EventMetadata; } /** @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionId RESTAURANTS.VARIANT_READ * @webhook * @eventType wix.restaurants.menus.v1.item_variant_deleted * @serviceIdentifier wix.restaurants.menus_item_variant.v1.VariantsService * @slug deleted * @documentationMaturity preview */ declare function onItemVariantDeleted(handler: (event: ItemVariantDeletedEnvelope) => void | Promise): void; interface ItemVariantUpdatedEnvelope { entity: Variant; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionId RESTAURANTS.VARIANT_READ * @webhook * @eventType wix.restaurants.menus.v1.item_variant_updated * @serviceIdentifier wix.restaurants.menus_item_variant.v1.VariantsService * @slug updated * @documentationMaturity preview */ declare function onItemVariantUpdated(handler: (event: ItemVariantUpdatedEnvelope) => void | Promise): void; /** * > **Note:** The Item Variants API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Creates an item variant. * * To create multiple item variants at once, use [Bulk Create Variants](https://dev.wix.com/docs/rest/business-solutions/restaurants/menus/item-variant/bulk-create-variants). * @param variant - Item variant info. * @public * @documentationMaturity preview * @requiredField variant * @requiredField variant.name * @permissionId RESTAURANTS.VARIANT_CREATE * @applicableIdentity APP * @returns Item variant. * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.CreateVariant */ declare function createVariant(variant: NonNullablePaths): Promise>; /** * > **Note:** The Item Variants API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Retrieves an item variant by ID. * @param variantId - ID of the item variant to retrieve. * @public * @documentationMaturity preview * @requiredField variantId * @permissionId RESTAURANTS.VARIANT_READ * @applicableIdentity APP * @returns Item variant. * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.GetVariant */ declare function getVariant(variantId: string): Promise>; /** * > **Note:** The Item Variants API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Retrieves a list of up to 500 item variants. * @public * @documentationMaturity preview * @permissionId RESTAURANTS.VARIANT_READ * @applicableIdentity APP * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.ListVariants */ declare function listVariants(options?: ListVariantsOptions): Promise>; interface ListVariantsOptions { /** * Item variant IDs. * @format GUID * @maxSize 500 */ variantIds?: string[]; /** The metadata of the paginated results. */ paging?: CursorPaging; } /** * > **Note:** The Item Variants API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Updates an item variant. * * To update multiple item variants at once, use [Bulk Update Variants](https://dev.wix.com/docs/rest/business-solutions/restaurants/menus/item-variant/bulk-update-variants). * * Each time an item variant is updated, its revision increments by 1. The existing revision must be included when updating the variant. This ensures you're working with the latest variant information, and it prevents unintended overwrites. * @param _id - Item variant ID. * @public * @documentationMaturity preview * @requiredField _id * @requiredField variant * @requiredField variant.revision * @permissionId RESTAURANTS.VARIANT_UPDATE * @applicableIdentity APP * @returns Updated item variant. * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.UpdateVariant */ declare function updateVariant(_id: string, variant: NonNullablePaths): Promise>; interface UpdateVariant { /** * Item variant ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the item variant is updated. To prevent conflicting changes, the current revision must be passed when updating the item variant. Ignored when creating an item variant. * @readonly */ revision?: string | null; /** * Date and time the item variant was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the item variant was updated. * @readonly */ _updatedDate?: Date | null; /** * Item variant name. * @minLength 1 * @maxLength 200 */ name?: string | null; /** Extended fields. */ extendedFields?: ExtendedFields; /** * IDs of the business locations ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations)) where these item variants are available. * @maxSize 100 * @format GUID * @readonly */ businessLocationIds?: string[]; } /** * > **Note:** The Item Variants API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Creates multiple item variants. * @param variants - Item variants details. * @public * @documentationMaturity preview * @requiredField variants * @permissionId RESTAURANTS.VARIANT_CREATE * @applicableIdentity APP * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.BulkCreateVariants */ declare function bulkCreateVariants(variants: Variant[], options?: BulkCreateVariantsOptions): Promise>; interface BulkCreateVariantsOptions { /** Whether to receive the created item variants in the response. */ returnEntity?: boolean; } /** * > **Note:** The Item Variants API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Updates multiple item variants. * * Each time an item variant is updated, its revision increments by 1. The existing revision must be included when updating variant. This ensures you're working with the latest item information, and it prevents unintended overwrites. * * Up to 100 item variants can be returned per request. * @param variants - Item variants to be updated. * @public * @documentationMaturity preview * @requiredField variants * @permissionId RESTAURANTS.VARIANT_UPDATE * @applicableIdentity APP * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.BulkUpdateVariants */ declare function bulkUpdateVariants(variants: MaskedVariant[], options?: BulkUpdateVariantsOptions): Promise>; interface BulkUpdateVariantsOptions { /** Whether to receive the updated item variants in the response. */ returnEntity?: boolean; } /** * > **Note:** The Item Variants API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Permanently deletes an item variant. * @param variantId - Item variant ID. * @public * @documentationMaturity preview * @requiredField variantId * @permissionId RESTAURANTS.VARIANT_DELETE * @applicableIdentity APP * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.DeleteVariant */ declare function deleteVariant(variantId: string): Promise; /** * Creates a query to retrieve a list of item variants. * * The `queryVariants()` function builds a query to retrieve a list of item variants and returns a `VariantsQueryBuilder` object. * * The returned object contains the query definition, which is used to run the query using the [`find()`](/item-variants/variants-query-builder/find) function. * * You can refine the query by chaining `VariantsQueryBuilder` functions onto the query. `VariantsQueryBuilder` functions enable you to filter, sort, and control the results that `queryVariants()` returns. * * `queryVariants()` runs with the following `VariantsQueryBuilder` defaults, which you can override: * * * [`limit(500)`](/item-variants/variants-query-builder/limit) * * The following `VariantsQueryBuilder` functions are supported for `queryVariants()`. For a full description of the item variant object, see the object returned for the [`items`](/item-variants/variants-query-result/items) property in `VariantsQueryResult`. * @public * @documentationMaturity preview * @permissionId RESTAURANTS.VARIANT_READ * @applicableIdentity APP * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.QueryVariants */ declare function queryVariants(): VariantsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface VariantsQueryResult extends QueryCursorResult { items: Variant[]; query: VariantsQueryBuilder; next: () => Promise; prev: () => Promise; } interface VariantsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => VariantsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => VariantsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => VariantsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => VariantsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ le: (propertyName: '_createdDate' | '_updatedDate', value: any) => VariantsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => VariantsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id' | 'name', value: any) => VariantsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => VariantsQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => VariantsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * @hidden * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.QueryVariants * @requiredField query */ declare function typedQueryVariants(query: VariantQuery): Promise>; interface VariantQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: ['_id', 'name']; operators: ['$eq', '$in', '$ne', '$nin']; sort: 'NONE'; }, { fields: ['_createdDate', '_updatedDate']; operators: ['$eq', '$gt', '$gte', '$lt', '$lte', '$ne']; sort: 'NONE'; } ]; } type CommonQueryWithEntityContext = Query; type VariantQuery = { /** 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?: { /** Number of items to load. @max: 500 */ limit?: NonNullable['limit'] | 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. @maxLength: 16000 */ cursor?: NonNullable['cursor'] | null; }; /** Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: CommonQueryWithEntityContext['filter'] | null; /** Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` @maxSize: 4 */ sort?: { /** Name of the field to sort by. @maxLength: 64 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; }[]; }; declare const utils: { query: { QueryBuilder: () => _wix_sdk_types.QueryBuilder; Filter: _wix_sdk_types.FilterFactory; Sort: _wix_sdk_types.SortFactory; }; }; /** * > **Note:** The Item API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Retrieves the number of item variants that match a specified filter. * * If a filter isn't passed in the request, the endpoint returns the count of all item variants. * @public * @documentationMaturity preview * @permissionId RESTAURANTS.VARIANT_READ * @applicableIdentity APP * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.CountVariants */ declare function countVariants(options?: CountVariantsOptions): Promise & { __applicationErrorsType?: CountVariantsApplicationErrors; }>; interface CountVariantsOptions { /** Filter for counting variants. */ filter?: Record | null; } /** * > **Note:** The Item Variants API only works with the Wix Restaurants Menus app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new). * * Deletes multiple item variants at once. * @param ids - Item variant IDs. * @public * @documentationMaturity preview * @requiredField ids * @permissionId RESTAURANTS.VARIANT_DELETE * @applicableIdentity APP * @fqn wix.restaurants.menus_item_variant.v1.VariantsService.BulkDeleteVariants */ declare function bulkDeleteVariants(ids: string[]): Promise>; export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateVariantsOptions, type BulkCreateVariantsRequest, type BulkCreateVariantsResponse, type BulkDeleteVariantsRequest, type BulkDeleteVariantsResponse, type BulkDeleteVariantsResult, type BulkItemResult, type BulkUpdateAttachedToOrphanItemRequest, type BulkUpdateAttachedToOrphanItemResponse, type BulkUpdateBusinessLocationIdsPerEntityRequest, type BulkUpdateBusinessLocationIdsPerEntityResponse, type BulkUpdateBusinessLocationIdsPerEntityResponseBulkItemResult, type BulkUpdateBusinessLocationIdsRequest, type BulkUpdateBusinessLocationIdsResponse, type BulkUpdateBusinessLocationIdsResponseBulkItemResult, type BulkUpdateVariantsOptions, type BulkUpdateVariantsRequest, type BulkUpdateVariantsResponse, type BulkVariantResult, type CloneVariantsRequest, type CloneVariantsResponse, type CommonQueryWithEntityContext, type CountVariantsApplicationErrors, type CountVariantsOptions, type CountVariantsRequest, type CountVariantsResponse, type CreateVariantRequest, type CreateVariantResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type DeleteVariantRequest, type DeleteVariantResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type ExternalReferenceInfo, type File, type GetVariantRequest, type GetVariantResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type ItemVariantCreatedEnvelope, type ItemVariantDeletedEnvelope, type ItemVariantUpdatedEnvelope, type ListVariantsOptions, type ListVariantsRequest, type ListVariantsResponse, type MaskedVariant, type MessageEnvelope, type Page, type Pages, type QueryVariantsRequest, type QueryVariantsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type SyncContentToMultilingualRequest, type SyncContentToMultilingualResponse, type URI, type URIs, type UpdateVariant, type UpdateVariantRequest, type UpdateVariantResponse, type Variant, type VariantIdAttachedToOrphanItem, type VariantIdLocationIds, type VariantQuery, type VariantQuerySpec, type VariantsQueryBuilder, type VariantsQueryResult, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateVariants, bulkDeleteVariants, bulkUpdateVariants, countVariants, createVariant, deleteVariant, getVariant, listVariants, onItemVariantCreated, onItemVariantDeleted, onItemVariantUpdated, queryVariants, typedQueryVariants, updateVariant, utils };