import * as _wix_sdk_types from '@wix/sdk-types';
import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
/**
* An item modifier is a type of menu item that serves as an addition to a menu item.
* Read more about [item modifiers](https://dev.wix.com/docs/rest/business-solutions/restaurants/menus/item-modifiers/introduction).
*/
interface Modifier {
/**
* Item modifier ID.
* @format GUID
* @readonly
*/
_id?: string | null;
/**
* Revision number, which increments by 1 each time the item modifier is updated.
* To prevent conflicting changes,
* the current revision must be passed when updating the item modifier.
*
* Ignored when creating an item modifier.
* @readonly
*/
revision?: string | null;
/**
* Date and time the item modifier was created.
* @readonly
*/
_createdDate?: Date | null;
/**
* Date and time the item modifier was updated.
* @readonly
*/
_updatedDate?: Date | null;
/**
* Item modifier display name.
* @minLength 1
* @maxLength 200
*/
name?: string | null;
/** Extended fields. */
extendedFields?: ExtendedFields;
/**
* Whether the modifier is in stock.
* Default: `true`.
*/
inStock?: boolean | null;
/**
* 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 modifiers 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 modifier 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 CreateModifierRequest {
/** Item modifier to create. */
modifier: Modifier;
}
interface CreateModifierResponse {
/** Created item modifier. */
modifier?: Modifier;
}
interface GetModifierRequest {
/**
* ID of the item modifier to retrieve.
* @format GUID
*/
modifierId: string;
}
interface GetModifierResponse {
/** Retrieved item modifier. */
modifier?: Modifier;
}
interface ListModifiersRequest {
/**
* IDs of the item modifiers to retrieve.
* @format GUID
* @maxSize 500
*/
modifierIds?: string[];
/** Metadata of the paginated results. */
paging?: CursorPaging;
}
interface CursorPaging {
/**
* Maximum 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.
*/
cursor?: string | null;
}
interface ListModifiersResponse {
/** Retrieved item modifiers. */
modifiers?: Modifier[];
/** Metadata of the paginated results. */
metadata?: CursorPagingMetadata;
}
interface CursorPagingMetadata {
/** Number of items returned in the response. */
count?: number | null;
/** Cursor pointing to the next page and the previous page in the list of results. */
cursors?: Cursors;
/**
* Whether 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. */
next?: string | null;
/** Cursor pointing to previous page in the list of results. */
prev?: string | null;
}
interface UpdateModifierRequest {
/** Item Modifier with updated properties. */
modifier: Modifier;
}
interface UpdateModifierResponse {
/** Updated item modifier. */
modifier?: Modifier;
}
interface BulkCreateModifiersRequest {
/**
* List of item modifiers to create.
* @maxSize 100
*/
modifiers: Modifier[];
/**
* Whether the created item modifiers are included in the response.
* Default: `false`.
*/
returnEntity?: boolean;
}
interface BulkCreateModifiersResponse {
/** Information about the created item modifiers. */
results?: BulkCreateModifierResult[];
/** Metadata for Bulk Create Modifiers API call. */
bulkActionMetadata?: BulkActionMetadata;
}
interface BulkCreateModifierResult {
/** Metadata for creation of the item modifer. */
itemMetadata?: ItemMetadata;
/** Created item modifier. */
modifier?: Modifier;
}
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 BulkUpdateModifiersRequest {
/**
* List of item modifiers to update.
* @minSize 1
* @maxSize 100
*/
modifiers: MaskedModifier[];
/** Whether the updated item modifiers are included in the response. */
returnEntity?: boolean;
}
interface MaskedModifier {
/** Item modifier to update. */
modifier?: Modifier;
/** Explicit list of fields to update. */
mask?: string[];
}
interface BulkUpdateModifiersResponse {
/**
* Information about the updated item modifiers.
* @minSize 1
* @maxSize 100
*/
results?: BulkUpdateModifierResult[];
/** Metadata for Bulk Update Modifiers API call. */
bulkActionMetadata?: BulkActionMetadata;
}
interface BulkUpdateModifierResult {
/** Metadata for the update of the item modifer. */
itemMetadata?: ItemMetadata;
/** Updated item modifier. */
modifier?: Modifier;
}
interface DeleteModifierRequest {
/**
* ID of the item modifier to delete.
* @format GUID
*/
modifierId: string;
}
interface DeleteModifierResponse {
}
interface QueryModifiersRequest {
/** 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.
* See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
* for more information.
*/
filter?: Record | null;
/** Sort object. */
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 512
*/
fieldName?: string;
/** Sort order. */
order?: SortOrderWithLiterals;
}
declare enum SortOrder {
ASC = "ASC",
DESC = "DESC"
}
/** @enumType */
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
interface QueryModifiersResponse {
/** Retrieved item modifiers. */
modifiers?: Modifier[];
/** Metadata of the paginated results. */
pagingMetadata?: CursorPagingMetadata;
}
interface CountModifiersRequest {
/** Filter for counting modifiers. */
filter?: Record | null;
}
interface CountModifiersResponse {
/** Counted modifiers. */
count?: number;
}
interface BulkDeleteModifiersRequest {
/**
* Item Modifier IDs.
* @format GUID
* @maxSize 200
*/
ids: string[];
}
interface BulkDeleteModifiersResponse {
/** Information about the deleted modifiers. */
results?: BulkDeleteModifiersResult[];
/** Metadata for the API call. */
bulkActionMetadata?: BulkActionMetadata;
}
interface BulkDeleteModifiersResult {
/** Metadata for modifiers deletion. */
itemMetadata?: ItemMetadata;
}
interface CloneModifiersRequest {
/**
* The MetaSiteId to clone from
* @format GUID
*/
metaSiteId?: string;
}
interface CloneModifiersResponse {
}
interface BulkUpdateBusinessLocationIdsRequest {
/**
* modifier ids
* @format GUID
* @minSize 1
* @maxSize 100
*/
modifierIds?: string[];
/**
* Business Location Ids.
* @maxSize 20
* @format GUID
*/
businessLocationIds?: string[];
}
interface BulkUpdateBusinessLocationIdsResponse {
/**
* Information about the updated modifiers.
* @minSize 1
* @maxSize 100
*/
results?: BulkUpdateBusinessLocationIdsResponseBulkItemResult[];
}
interface BulkUpdateBusinessLocationIdsResponseBulkItemResult {
/** Metadata for item update. */
itemMetadata?: ItemMetadata;
}
interface BulkUpdateBusinessLocationIdsPerEntityRequest {
/**
* @minSize 1
* @maxSize 100
*/
modifierIdLocationIds?: ModifierIdLocationIds[];
}
interface ModifierIdLocationIds {
/**
* modifier ID
* @format GUID
*/
modifierId?: string;
/**
* Business Location IDs
* @maxSize 20
* @format GUID
*/
businessLocationIds?: string[];
}
interface BulkUpdateBusinessLocationIdsPerEntityResponse {
/**
* Information about the updated modifiers.
* @minSize 1
* @maxSize 100
*/
results?: BulkUpdateBusinessLocationIdsPerEntityResponseBulkItemResult[];
}
interface BulkUpdateBusinessLocationIdsPerEntityResponseBulkItemResult {
/** Metadata for item update. */
itemMetadata?: ItemMetadata;
}
interface BulkUpdateAttachedToOrphanItemRequest {
/**
* @minSize 1
* @maxSize 100
*/
modifierIdAttachedToOrphanItem?: ModifierIdAttachedToOrphanItem[];
}
interface ModifierIdAttachedToOrphanItem {
/**
* Modifier ID
* @format GUID
*/
modifierId?: string;
/** Attached to orphan item */
attachedToOrphanItem?: boolean;
}
interface BulkUpdateAttachedToOrphanItemResponse {
/**
* Information about the updated modifiers.
* @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 CountModifiersApplicationErrors = {
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 ItemModifierCreatedEnvelope {
entity: Modifier;
metadata: EventMetadata;
}
/** @permissionScope Manage Restaurants - all permissions
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
* @permissionId RESTAURANTS.MODIFIER_READ
* @webhook
* @eventType wix.restaurants.menus.v1.item_modifier_created
* @serviceIdentifier wix.restaurants.menus_item_modifier.v1.ModifiersService
* @slug created
* @documentationMaturity preview
*/
declare function onItemModifierCreated(handler: (event: ItemModifierCreatedEnvelope) => void | Promise): void;
interface ItemModifierDeletedEnvelope {
metadata: EventMetadata;
}
/** @permissionScope Manage Restaurants - all permissions
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
* @permissionId RESTAURANTS.MODIFIER_READ
* @webhook
* @eventType wix.restaurants.menus.v1.item_modifier_deleted
* @serviceIdentifier wix.restaurants.menus_item_modifier.v1.ModifiersService
* @slug deleted
* @documentationMaturity preview
*/
declare function onItemModifierDeleted(handler: (event: ItemModifierDeletedEnvelope) => void | Promise): void;
interface ItemModifierUpdatedEnvelope {
entity: Modifier;
metadata: EventMetadata;
/** @hidden */
modifiedFields: Record;
}
/** @permissionScope Manage Restaurants - all permissions
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
* @permissionId RESTAURANTS.MODIFIER_READ
* @webhook
* @eventType wix.restaurants.menus.v1.item_modifier_updated
* @serviceIdentifier wix.restaurants.menus_item_modifier.v1.ModifiersService
* @slug updated
* @documentationMaturity preview
*/
declare function onItemModifierUpdated(handler: (event: ItemModifierUpdatedEnvelope) => void | Promise): void;
/**
* > **Note:** The Item Modifiers API only works with the Wix Restaurants Menus (New) 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 modifier.
*
* To create multiple item modifiers at once, use [Bulk Create Modifiers](https://dev.wix.com/docs/rest/business-solutions/restaurants/menus/item-modifiers/bulk-create-modifiers).
* @param modifier - Item modifier to create.
* @public
* @documentationMaturity preview
* @requiredField modifier
* @requiredField modifier.name
* @permissionId RESTAURANTS.MODIFIER_CREATE
* @applicableIdentity APP
* @returns Created item modifier.
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.CreateModifier
*/
declare function createModifier(modifier: NonNullablePaths): Promise>;
/**
* > **Note:** The Item Modifier API only works with the Wix Restaurants Menus (New) 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 modifier by ID.
* @param modifierId - ID of the item modifier to retrieve.
* @public
* @documentationMaturity preview
* @requiredField modifierId
* @permissionId RESTAURANTS.MODIFIER_READ
* @applicableIdentity APP
* @returns Retrieved item modifier.
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.GetModifier
*/
declare function getModifier(modifierId: string): Promise>;
/**
* > **Note:** The Item Modifier API only works with the Wix Restaurants Menus (New) 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 modifiers.
* @public
* @documentationMaturity preview
* @permissionId RESTAURANTS.MODIFIER_READ
* @applicableIdentity APP
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.ListModifiers
*/
declare function listModifiers(options?: ListModifiersOptions): Promise>;
interface ListModifiersOptions {
/**
* IDs of the item modifiers to retrieve.
* @format GUID
* @maxSize 500
*/
modifierIds?: string[];
/** Metadata of the paginated results. */
paging?: CursorPaging;
}
/**
* > **Note:** The Item Modifier API only works with the Wix Restaurants Menus (New) 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 modifier.
*
* To update multiple item modifiers at once, use [Bulk Update Item Modifiers](https://dev.wix.com/docs/rest/business-solutions/restaurants/menus/item-modifiers/bulk-update-modifiers).
*
* Each time an item modifier is updated, its revision increments by 1. The existing revision must be included when updating an item modifier. This ensures you're working with the latest item modifier information, and it prevents unintended overwrites.
* @param _id - Item modifier ID.
* @public
* @documentationMaturity preview
* @requiredField _id
* @requiredField modifier
* @requiredField modifier.revision
* @permissionId RESTAURANTS.MODIFIER_UPDATE
* @applicableIdentity APP
* @returns Updated item modifier.
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.UpdateModifier
*/
declare function updateModifier(_id: string, modifier: NonNullablePaths): Promise>;
interface UpdateModifier {
/**
* Item modifier ID.
* @format GUID
* @readonly
*/
_id?: string | null;
/**
* Revision number, which increments by 1 each time the item modifier is updated.
* To prevent conflicting changes,
* the current revision must be passed when updating the item modifier.
*
* Ignored when creating an item modifier.
* @readonly
*/
revision?: string | null;
/**
* Date and time the item modifier was created.
* @readonly
*/
_createdDate?: Date | null;
/**
* Date and time the item modifier was updated.
* @readonly
*/
_updatedDate?: Date | null;
/**
* Item modifier display name.
* @minLength 1
* @maxLength 200
*/
name?: string | null;
/** Extended fields. */
extendedFields?: ExtendedFields;
/**
* Whether the modifier is in stock.
* Default: `true`.
*/
inStock?: boolean | null;
/**
* 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 modifiers are available.
* @maxSize 100
* @format GUID
* @readonly
*/
businessLocationIds?: string[];
}
/**
* > **Note:** The Item Modifier API only works with the Wix Restaurants Menus (New) 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 modifiers.
* @param modifiers - List of item modifiers to create.
* @public
* @documentationMaturity preview
* @requiredField modifiers
* @permissionId RESTAURANTS.MODIFIER_CREATE
* @applicableIdentity APP
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.BulkCreateModifiers
*/
declare function bulkCreateModifiers(modifiers: Modifier[], options?: BulkCreateModifiersOptions): Promise>;
interface BulkCreateModifiersOptions {
/**
* Whether the created item modifiers are included in the response.
* Default: `false`.
*/
returnEntity?: boolean;
}
/**
* > **Note:** The Item modifier API only works with the Wix Restaurants Menus (New) 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 modifiers at once.
* Each time an item modifier is updated, its revision increments by 1. The existing revision must be included when updating the item modifier. This ensures you're working with the latest item modifier information, and prevents unintended overwrites.
* @param modifiers - List of item modifiers to update.
* @public
* @documentationMaturity preview
* @requiredField modifiers
* @permissionId RESTAURANTS.MODIFIER_UPDATE
* @applicableIdentity APP
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.BulkUpdateModifiers
*/
declare function bulkUpdateModifiers(modifiers: MaskedModifier[], options?: BulkUpdateModifiersOptions): Promise>;
interface BulkUpdateModifiersOptions {
/** Whether the updated item modifiers are included in the response. */
returnEntity?: boolean;
}
/**
* > **Note:** The Item modifier API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
* Deletes an item modifier.
* @param modifierId - ID of the item modifier to delete.
* @public
* @documentationMaturity preview
* @requiredField modifierId
* @permissionId RESTAURANTS.MODIFIER_DELETE
* @applicableIdentity APP
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.DeleteModifier
*/
declare function deleteModifier(modifierId: string): Promise;
/**
* Creates a query to retrieve a list of item modifiers.
*
* The `queryModifiers()` function builds a query to retrieve a list of item modifiers and returns a `ModifiersQueryBuilder` object.
*
* The returned object contains the query definition, which is used to run the query using the [`find()`](/item-modifiers/modifiers-query-builder/find) function.
*
* You can refine the query by chaining `ModifiersQueryBuilder` functions onto the query. `ModifiersQueryBuilder` functions enable you to filter, sort, and control the results that `queryModifiers()` returns.
*
* `queryModifiers()` runs with the following `ModifiersQueryBuilder` defaults, which you can override:
*
* * [`limit(500)`](/item-modifiers/modifiers-query-builder/limit)
*
* The following `ModifiersQueryBuilder` functions are supported for `queryModifiers()`. For a full description of the item modifier object, see the object returned for the [`items`](/item-modifiers/modifiers-query-result/items) property in `ModifiersQueryResult`.
* @public
* @documentationMaturity preview
* @permissionId RESTAURANTS.MODIFIER_READ
* @applicableIdentity APP
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.QueryModifiers
*/
declare function queryModifiers(): ModifiersQueryBuilder;
interface QueryCursorResult {
cursors: Cursors;
hasNext: () => boolean;
hasPrev: () => boolean;
length: number;
pageSize: number;
}
interface ModifiersQueryResult extends QueryCursorResult {
items: Modifier[];
query: ModifiersQueryBuilder;
next: () => Promise;
prev: () => Promise;
}
interface ModifiersQueryBuilder {
/** @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) => ModifiersQueryBuilder;
/** @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) => ModifiersQueryBuilder;
/** @param propertyName - Property whose value is compared with `value`.
* @param value - Value to compare against.
* @documentationMaturity preview
*/
ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ModifiersQueryBuilder;
/** @param propertyName - Property whose value is compared with `value`.
* @param value - Value to compare against.
* @documentationMaturity preview
*/
gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ModifiersQueryBuilder;
/** @param propertyName - Property whose value is compared with `value`.
* @param value - Value to compare against.
* @documentationMaturity preview
*/
le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ModifiersQueryBuilder;
/** @param propertyName - Property whose value is compared with `value`.
* @param value - Value to compare against.
* @documentationMaturity preview
*/
lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ModifiersQueryBuilder;
/** @documentationMaturity preview */
in: (propertyName: '_id' | 'name', value: any) => ModifiersQueryBuilder;
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
* @documentationMaturity preview
*/
limit: (limit: number) => ModifiersQueryBuilder;
/** @param cursor - A pointer to specific record
* @documentationMaturity preview
*/
skipTo: (cursor: string) => ModifiersQueryBuilder;
/** @documentationMaturity preview */
find: () => Promise;
}
/**
* @hidden
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.QueryModifiers
* @requiredField query
*/
declare function typedQueryModifiers(query: ModifierQuery): Promise>;
interface ModifierQuerySpec 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 ModifierQuery = {
/**
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?: {
/**
Maximum 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.
*/
cursor?: NonNullable['cursor'] | null;
};
/**
Filter object.
See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
for more information.
*/
filter?: CommonQueryWithEntityContext['filter'] | null;
/**
Sort object.
*/
sort?: {
/**
Name of the field to sort by.
@maxLength: 512
*/
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 (New) 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 modifiers that match a specified filter.
*
* If a filter isn't passed in the request, the endpoint returns the count of all modifiers.
* @public
* @documentationMaturity preview
* @permissionId RESTAURANTS.MODIFIER_READ
* @applicableIdentity APP
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.CountModifiers
*/
declare function countModifiers(options?: CountModifiersOptions): Promise & {
__applicationErrorsType?: CountModifiersApplicationErrors;
}>;
interface CountModifiersOptions {
/** Filter for counting modifiers. */
filter?: Record | null;
}
/**
* > **Note:** The Item Modifier API only works with the Wix Restaurants Menus (New) 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 Modifiers at once.
* @param ids - Item Modifier IDs.
* @public
* @documentationMaturity preview
* @requiredField ids
* @permissionId RESTAURANTS.MODIFIER_DELETE
* @applicableIdentity APP
* @fqn wix.restaurants.menus_item_modifier.v1.ModifiersService.BulkDeleteModifiers
*/
declare function bulkDeleteModifiers(ids: string[]): Promise>;
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateModifierResult, type BulkCreateModifiersOptions, type BulkCreateModifiersRequest, type BulkCreateModifiersResponse, type BulkDeleteModifiersRequest, type BulkDeleteModifiersResponse, type BulkDeleteModifiersResult, type BulkItemResult, type BulkUpdateAttachedToOrphanItemRequest, type BulkUpdateAttachedToOrphanItemResponse, type BulkUpdateBusinessLocationIdsPerEntityRequest, type BulkUpdateBusinessLocationIdsPerEntityResponse, type BulkUpdateBusinessLocationIdsPerEntityResponseBulkItemResult, type BulkUpdateBusinessLocationIdsRequest, type BulkUpdateBusinessLocationIdsResponse, type BulkUpdateBusinessLocationIdsResponseBulkItemResult, type BulkUpdateModifierResult, type BulkUpdateModifiersOptions, type BulkUpdateModifiersRequest, type BulkUpdateModifiersResponse, type CloneModifiersRequest, type CloneModifiersResponse, type CommonQueryWithEntityContext, type CountModifiersApplicationErrors, type CountModifiersOptions, type CountModifiersRequest, type CountModifiersResponse, type CreateModifierRequest, type CreateModifierResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type DeleteModifierRequest, type DeleteModifierResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type ExternalReferenceInfo, type File, type GetModifierRequest, type GetModifierResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type ItemModifierCreatedEnvelope, type ItemModifierDeletedEnvelope, type ItemModifierUpdatedEnvelope, type ListModifiersOptions, type ListModifiersRequest, type ListModifiersResponse, type MaskedModifier, type MessageEnvelope, type Modifier, type ModifierIdAttachedToOrphanItem, type ModifierIdLocationIds, type ModifierQuery, type ModifierQuerySpec, type ModifiersQueryBuilder, type ModifiersQueryResult, type Page, type Pages, type QueryModifiersRequest, type QueryModifiersResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type SyncContentToMultilingualRequest, type SyncContentToMultilingualResponse, type URI, type URIs, type UpdateModifier, type UpdateModifierRequest, type UpdateModifierResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateModifiers, bulkDeleteModifiers, bulkUpdateModifiers, countModifiers, createModifier, deleteModifier, getModifier, listModifiers, onItemModifierCreated, onItemModifierDeleted, onItemModifierUpdated, queryModifiers, typedQueryModifiers, updateModifier, utils };