import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; /** A Ribbon is a visual element that you can assign to products to highlight them on your site. */ interface Ribbon { /** * Ribbon ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the ribbon is updated. * To prevent conflicting changes, * the current revision must be passed when updating the ribbon. * * Ignored when creating a ribbon. * @readonly */ revision?: string | null; /** * Date and time the ribbon was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the ribbon was updated. * @readonly */ _updatedDate?: Date | null; /** * Ribbon name. * @minLength 1 * @maxLength 30 */ name?: string; /** * Number of products this ribbon is assigned to. * > **Note:** Returned only when you pass `"ASSIGNED_PRODUCT_COUNT"` to the `fields` array in Ribbon API requests. * @readonly */ assignedProductCount?: number | 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 CreateRibbonRequest { /** Ribbon to create. */ ribbon: Ribbon; } interface CreateRibbonResponse { /** Created ribbon. */ ribbon?: Ribbon; } interface GetRibbonRequest { /** * Ribbon ID. * @format GUID */ ribbonId: string; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } declare enum RequestedFields { UNKNOWN_REQUESTED_FIELD = "UNKNOWN_REQUESTED_FIELD", ASSIGNED_PRODUCT_COUNT = "ASSIGNED_PRODUCT_COUNT" } /** @enumType */ type RequestedFieldsWithLiterals = RequestedFields | 'UNKNOWN_REQUESTED_FIELD' | 'ASSIGNED_PRODUCT_COUNT'; interface GetRibbonResponse { /** Ribbon. */ ribbon?: Ribbon; } interface UpdateRibbonRequest { /** Ribbon to update. */ ribbon: Ribbon; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface UpdateRibbonResponse { /** Updated Ribbon. */ ribbon?: Ribbon; } interface DeleteRibbonRequest { /** * Ribbon ID. * @format GUID */ ribbonId: string; } interface DeleteRibbonResponse { } interface QueryRibbonsRequest { /** Query options. */ query?: CursorQuery; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } 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 512 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { /** Ascending order. */ ASC = "ASC", /** Descending order. */ DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface CursorPaging { /** * Maximum number of items to return in the results. * @max 100 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass 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 QueryRibbonsResponse { /** * List of ribbons. * @minSize 1 * @maxSize 100 */ ribbons?: Ribbon[]; /** Details on the paged set of results returned. */ pagingMetadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface BulkCreateRibbonsRequest { /** * Ribbons to create. * @minSize 1 * @maxSize 100 */ ribbons: Ribbon[]; /** * Whether to return the full created ribbon entities in the response. * * Default: `false` */ returnEntity?: boolean; } interface BulkCreateRibbonsResponse { /** * Ribbons created by bulk action. * @maxSize 100 */ results?: V3BulkRibbonResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface V3BulkRibbonResult { /** Bulk action metadata for ribbon. */ itemMetadata?: ItemMetadata; /** * Full ribbon entity. * * Returned only if `returnEntity: true` is passed in the request. */ item?: Ribbon; } interface ItemMetadata { /** * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). * @format GUID */ _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 BulkUpdateRibbonsRequest { /** * List of ribbons to update. * @minSize 1 * @maxSize 100 */ ribbons: MaskedRibbon[]; /** * Whether to return the full updated ribbon entities in the response. * * Default: `false` */ returnEntity?: boolean; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface MaskedRibbon { /** Ribbon to update. */ ribbon?: Ribbon; /** Explicit list of fields to update. */ fieldMask?: string[]; } interface BulkUpdateRibbonsResponse { /** * Ribbons updated by bulk action. * @maxSize 100 */ results?: V3BulkRibbonResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface GetOrCreateRibbonRequest { /** * Ribbon name to retrieve or create. * @minLength 1 * @maxLength 30 */ ribbonName: string; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface GetOrCreateRibbonResponse { /** Ribbon. */ ribbon?: Ribbon; } interface BulkGetOrCreateRibbonsRequest { /** * Ribbon names to retrieve or create. * @minLength 1 * @maxLength 30 * @minSize 1 * @maxSize 100 */ ribbonNames: string[]; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface BulkGetOrCreateRibbonsResponse { /** * Ribbons retrieved or created by bulk action. * @maxSize 100 */ results?: V3BulkRibbonResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkGetOrCreateRibbonsForMigrationRequest { /** * Ribbons to get or create (id and name are used; id is preserved). * @minSize 1 * @maxSize 100 */ ribbons?: Ribbon[]; /** * Fields to include in the response. Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface BulkGetOrCreateRibbonsForMigrationResponse { /** * Per-ribbon results. * @maxSize 100 */ results?: V3BulkRibbonResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkDeleteRibbonsRequest { /** * IDs of ribbons to delete. * @format GUID * @minSize 1 * @maxSize 100 */ ribbonIds: string[]; } interface BulkDeleteRibbonsResponse { /** * Ribbons deleted by bulk action. * @maxSize 100 */ results?: BulkRibbonResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkRibbonResult { /** Bulk action metadata for ribbon. */ 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 RecloneSiteRequest { /** @format GUID */ cloneFrom?: string; } interface RecloneSiteResponse { } 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; } 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 RibbonCreatedEnvelope { entity: Ribbon; metadata: EventMetadata; } /** @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Read ribbons in v3 catalog * @permissionScopeId SCOPE.STORES.RIBBON_READ * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read * @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ * @permissionScope Read ribbons in v3 catalog (PII) * @permissionScopeId SCOPE.STORES.RIBBON_READ_LIMITED * @permissionScope Read v3 catalog * @permissionScopeId SCOPE.STORES.CATALOG_READ * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Read Stores - all read permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES * @permissionScope Read Products * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Product write in v3 catalog * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE * @permissionScope Manage v3 catalog * @permissionScopeId SCOPE.STORES.CATALOG_WRITE * @permissionScope Read v3 catalog (PII) * @permissionScopeId SCOPE.STORES.CATALOG_READ_LIMITED * @permissionScope Manage Orders * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS * @permissionId WIX_STORES.RIBBON_READ * @webhook * @eventType wix.stores.catalog.v3.ribbon_created * @slug created */ declare function onRibbonCreated(handler: (event: RibbonCreatedEnvelope) => void | Promise): void; interface RibbonDeletedEnvelope { entity: Ribbon; metadata: EventMetadata; } /** @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Read ribbons in v3 catalog * @permissionScopeId SCOPE.STORES.RIBBON_READ * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read * @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ * @permissionScope Read ribbons in v3 catalog (PII) * @permissionScopeId SCOPE.STORES.RIBBON_READ_LIMITED * @permissionScope Read v3 catalog * @permissionScopeId SCOPE.STORES.CATALOG_READ * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Read Stores - all read permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES * @permissionScope Read Products * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Product write in v3 catalog * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE * @permissionScope Manage v3 catalog * @permissionScopeId SCOPE.STORES.CATALOG_WRITE * @permissionScope Read v3 catalog (PII) * @permissionScopeId SCOPE.STORES.CATALOG_READ_LIMITED * @permissionScope Manage Orders * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS * @permissionId WIX_STORES.RIBBON_READ * @webhook * @eventType wix.stores.catalog.v3.ribbon_deleted * @slug deleted */ declare function onRibbonDeleted(handler: (event: RibbonDeletedEnvelope) => void | Promise): void; interface RibbonUpdatedEnvelope { entity: Ribbon; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Read ribbons in v3 catalog * @permissionScopeId SCOPE.STORES.RIBBON_READ * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read * @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ * @permissionScope Read ribbons in v3 catalog (PII) * @permissionScopeId SCOPE.STORES.RIBBON_READ_LIMITED * @permissionScope Read v3 catalog * @permissionScopeId SCOPE.STORES.CATALOG_READ * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Read Stores - all read permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES * @permissionScope Read Products * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Product write in v3 catalog * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE * @permissionScope Manage v3 catalog * @permissionScopeId SCOPE.STORES.CATALOG_WRITE * @permissionScope Read v3 catalog (PII) * @permissionScopeId SCOPE.STORES.CATALOG_READ_LIMITED * @permissionScope Manage Orders * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS * @permissionId WIX_STORES.RIBBON_READ * @webhook * @eventType wix.stores.catalog.v3.ribbon_updated * @slug updated */ declare function onRibbonUpdated(handler: (event: RibbonUpdatedEnvelope) => void | Promise): void; /** * Creates a ribbon. * * To assign the ribbon to a product, include the `ribbon.id` or `ribbon.name` when [creating](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/create-product) or [updating](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/update-product) a product. * @param ribbon - Ribbon to create. * @public * @requiredField ribbon * @requiredField ribbon.name * @permissionId WIX_STORES.RIBBON_CREATE * @applicableIdentity APP * @returns Created ribbon. * @fqn wix.stores.catalog.ribbon.v3.RibbonService.CreateRibbon */ declare function createRibbon(ribbon: NonNullablePaths): Promise>; /** * Retrieves a ribbon. * @param ribbonId - Ribbon ID. * @public * @requiredField ribbonId * @permissionId WIX_STORES.RIBBON_READ * @applicableIdentity APP * @returns Ribbon. * @fqn wix.stores.catalog.ribbon.v3.RibbonService.GetRibbon */ declare function getRibbon(ribbonId: string, options?: GetRibbonOptions): Promise>; interface GetRibbonOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Updates a ribbon. * * * Each time the ribbon is updated, `revision` increments by 1. * The current `revision` must be passed when updating the ribbon. * This ensures you're working with the latest ribbon and prevents unintended overwrites. * @param _id - Ribbon ID. * @public * @requiredField _id * @requiredField ribbon * @requiredField ribbon.revision * @permissionId WIX_STORES.RIBBON_UPDATE * @applicableIdentity APP * @returns Updated Ribbon. * @fqn wix.stores.catalog.ribbon.v3.RibbonService.UpdateRibbon */ declare function updateRibbon(_id: string, ribbon: NonNullablePaths, options?: UpdateRibbonOptions): Promise>; interface UpdateRibbon { /** * Ribbon ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the ribbon is updated. * To prevent conflicting changes, * the current revision must be passed when updating the ribbon. * * Ignored when creating a ribbon. * @readonly */ revision?: string | null; /** * Date and time the ribbon was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the ribbon was updated. * @readonly */ _updatedDate?: Date | null; /** * Ribbon name. * @minLength 1 * @maxLength 30 */ name?: string; /** * Number of products this ribbon is assigned to. * > **Note:** Returned only when you pass `"ASSIGNED_PRODUCT_COUNT"` to the `fields` array in Ribbon API requests. * @readonly */ assignedProductCount?: number | null; } interface UpdateRibbonOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Deletes a ribbon. * * * > **Note:** Deleting a ribbon will also remove it from all products it is assigned to. * @param ribbonId - Ribbon ID. * @public * @requiredField ribbonId * @permissionId WIX_STORES.RIBBON_DELETE * @applicableIdentity APP * @fqn wix.stores.catalog.ribbon.v3.RibbonService.DeleteRibbon */ declare function deleteRibbon(ribbonId: string): Promise; /** * Retrieves a list of up to 100 ribbons, given the provided filtering, sorting, and cursor paging. * Pass supported values to the `fields` array in the request to include those fields in the response. * * * Query Brands runs with these defaults, which you can override: * * - `createdDate` is sorted in `DESC` order * - `cursorPaging.limit` is `100` * * To learn about working with _Query_ endpoints, see * [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), * and [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging). * @public * @permissionId WIX_STORES.RIBBON_READ * @applicableIdentity APP * @fqn wix.stores.catalog.ribbon.v3.RibbonService.QueryRibbons */ declare function queryRibbons(options?: QueryRibbonsOptions): RibbonsQueryBuilder; interface QueryRibbonsOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[] | undefined; } interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface RibbonsQueryResult extends QueryCursorResult { items: Ribbon[]; query: RibbonsQueryBuilder; next: () => Promise; prev: () => Promise; } interface RibbonsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => RibbonsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => RibbonsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ge: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => RibbonsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ gt: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => RibbonsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ le: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => RibbonsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ lt: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => RibbonsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. */ startsWith: (propertyName: '_id' | 'name', value: string) => RibbonsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasSome: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any[]) => RibbonsQueryBuilder; in: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => RibbonsQueryBuilder; exists: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: boolean) => RibbonsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ ascending: (...propertyNames: Array<'_createdDate' | '_updatedDate' | 'name'>) => RibbonsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ descending: (...propertyNames: Array<'_createdDate' | '_updatedDate' | 'name'>) => RibbonsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => RibbonsQueryBuilder; /** @param cursor - A pointer to specific record */ skipTo: (cursor: string) => RibbonsQueryBuilder; find: () => Promise; } /** * @hidden * @fqn wix.stores.catalog.ribbon.v3.RibbonService.QueryRibbons * @requiredField query */ declare function typedQueryRibbons(query: RibbonQuery, options?: QueryRibbonsOptions): Promise>; interface RibbonQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: ['_createdDate', '_updatedDate', 'name']; operators: '*'; sort: 'BOTH'; }, { fields: ['_id']; operators: '*'; sort: 'NONE'; } ]; } type CommonQueryWithEntityContext = Query; type RibbonQuery = { /** 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 return in the results. @max: 100 */ limit?: NonNullable['limit'] | null; /** Pointer to the next or previous page in the list of results. Pass 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: 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; }; }; /** * Creates multiple ribbons. * @param ribbons - Ribbons to create. * @public * @requiredField ribbons * @requiredField ribbons.name * @permissionId WIX_STORES.RIBBON_CREATE * @applicableIdentity APP * @fqn wix.stores.catalog.ribbon.v3.RibbonService.BulkCreateRibbons */ declare function bulkCreateRibbons(ribbons: NonNullablePaths[], options?: BulkCreateRibbonsOptions): Promise>; interface BulkCreateRibbonsOptions { /** * Whether to return the full created ribbon entities in the response. * * Default: `false` */ returnEntity?: boolean; } /** * Updates multiple ribbons. * * Each time a ribbon is updated, `revision` increments by 1. * The current `revision` must be passed when updating a ribbon. * This ensures you're working with the latest ribbon and prevents unintended overwrites. * @param ribbons - List of ribbons to update. * @public * @requiredField ribbons * @requiredField ribbons.ribbon._id * @requiredField ribbons.ribbon.revision * @permissionId WIX_STORES.RIBBON_UPDATE * @applicableIdentity APP * @fqn wix.stores.catalog.ribbon.v3.RibbonService.BulkUpdateRibbons */ declare function bulkUpdateRibbons(ribbons: NonNullablePaths[], options?: BulkUpdateRibbonsOptions): Promise>; interface BulkUpdateRibbonsOptions { /** * Whether to return the full updated ribbon entities in the response. * * Default: `false` */ returnEntity?: boolean; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Retrieves a ribbon by name, or creates a ribbon if one with the passed `ribbonName` doesn't exist. * @param ribbonName - Ribbon name to retrieve or create. * @public * @requiredField ribbonName * @permissionId WIX_STORES.RIBBON_GET_OR_CREATE * @applicableIdentity APP * @fqn wix.stores.catalog.ribbon.v3.RibbonService.GetOrCreateRibbon */ declare function getOrCreateRibbon(ribbonName: string, options?: GetOrCreateRibbonOptions): Promise>; interface GetOrCreateRibbonOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Retrieves multiple ribbons by name, or creates multiple ribbons if those with the passed `ribbonNames` don't exist. * @param ribbonNames - Ribbon names to retrieve or create. * @public * @requiredField ribbonNames * @permissionId WIX_STORES.RIBBON_GET_OR_CREATE * @applicableIdentity APP * @fqn wix.stores.catalog.ribbon.v3.RibbonService.BulkGetOrCreateRibbons */ declare function bulkGetOrCreateRibbons(ribbonNames: string[], options?: BulkGetOrCreateRibbonsOptions): Promise>; interface BulkGetOrCreateRibbonsOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Deletes multiple ribbons. * @param ribbonIds - IDs of ribbons to delete. * @public * @requiredField ribbonIds * @permissionId WIX_STORES.RIBBON_DELETE * @applicableIdentity APP * @fqn wix.stores.catalog.ribbon.v3.RibbonService.BulkDeleteRibbons */ declare function bulkDeleteRibbons(ribbonIds: string[]): Promise>; export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateRibbonsOptions, type BulkCreateRibbonsRequest, type BulkCreateRibbonsResponse, type BulkDeleteRibbonsRequest, type BulkDeleteRibbonsResponse, type BulkGetOrCreateRibbonsForMigrationRequest, type BulkGetOrCreateRibbonsForMigrationResponse, type BulkGetOrCreateRibbonsOptions, type BulkGetOrCreateRibbonsRequest, type BulkGetOrCreateRibbonsResponse, type BulkRibbonResult, type BulkUpdateRibbonsOptions, type BulkUpdateRibbonsRequest, type BulkUpdateRibbonsResponse, type CommonQueryWithEntityContext, type CreateRibbonRequest, type CreateRibbonResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type DeleteRibbonRequest, type DeleteRibbonResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type File, type GetOrCreateRibbonOptions, type GetOrCreateRibbonRequest, type GetOrCreateRibbonResponse, type GetRibbonOptions, type GetRibbonRequest, type GetRibbonResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type MaskedRibbon, type MessageEnvelope, type Page, type Pages, type QueryRibbonsOptions, type QueryRibbonsRequest, type QueryRibbonsResponse, type RecloneSiteRequest, type RecloneSiteResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, type Ribbon, type RibbonCreatedEnvelope, type RibbonDeletedEnvelope, type RibbonQuery, type RibbonQuerySpec, type RibbonUpdatedEnvelope, type RibbonsQueryBuilder, type RibbonsQueryResult, SortOrder, type SortOrderWithLiterals, type Sorting, type URI, type URIs, type UpdateRibbon, type UpdateRibbonOptions, type UpdateRibbonRequest, type UpdateRibbonResponse, type V3BulkRibbonResult, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateRibbons, bulkDeleteRibbons, bulkGetOrCreateRibbons, bulkUpdateRibbons, createRibbon, deleteRibbon, getOrCreateRibbon, getRibbon, onRibbonCreated, onRibbonDeleted, onRibbonUpdated, queryRibbons, typedQueryRibbons, updateRibbon, utils };