import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; /** * A brand is a visible property of a product. * Adding brands to your products can help improve site and product visibility on search engines. */ interface Brand { /** * Brand ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the brand is updated. * To prevent conflicting changes, * the current revision must be passed when updating the brand. * * Ignored when creating a brand. * @readonly */ revision?: string | null; /** * Date and time the brand was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the brand was updated. * @readonly */ _updatedDate?: Date | null; /** * Brand name. * >**Note:** `name` must be unique. * @minLength 1 * @maxLength 50 */ name?: string; /** * Number of products this brand is assigned to. * > **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Brand API requests. * @readonly */ assignedProductsCount?: 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 CreateBrandRequest { /** Brand to create. */ brand: Brand; } interface CreateBrandResponse { /** Created brand. */ brand?: Brand; } interface GetBrandRequest { /** * Brand ID. * @format GUID */ brandId: string; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } declare enum RequestedFields { ASSIGNED_PRODUCTS_COUNT = "ASSIGNED_PRODUCTS_COUNT" } /** @enumType */ type RequestedFieldsWithLiterals = RequestedFields | 'ASSIGNED_PRODUCTS_COUNT'; interface GetBrandResponse { /** Brand. */ brand?: Brand; } interface UpdateBrandRequest { /** Brand to update. */ brand: Brand; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface UpdateBrandResponse { /** Updated brand. */ brand?: Brand; } interface DeleteBrandRequest { /** * Brand ID. * @format GUID */ brandId: string; } interface DeleteBrandResponse { } interface QueryBrandsRequest { /** 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 5 */ 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 300 */ 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 QueryBrandsResponse { /** * List of brands. * @minSize 1 * @maxSize 300 */ brands?: Brand[]; /** Paging metadata. */ 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 BulkCreateBrandsRequest { /** * Brands to create. * @minSize 1 * @maxSize 100 */ brands: Brand[]; /** * Whether to return the full created brand entities in the response. * * Default: `false` */ returnEntity?: boolean; } interface BulkCreateBrandsResponse { /** * Brands created by bulk action. * @maxSize 100 */ results?: BulkBrandsResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkBrandsResult { /** Bulk action metadata for brand. */ itemMetadata?: ItemMetadata; /** * Full brand entity. * * Returned only if `returnEntity: true` is passed in the request. */ item?: Brand; } 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 BulkUpdateBrandsRequest { /** * List of brands to update. * @minSize 1 * @maxSize 100 */ brands: MaskedBrand[]; /** * Whether to return the full updated brand entities in the response. * * Default: `false` */ returnEntity?: boolean; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface MaskedBrand { /** Brand to update. */ brand?: Brand; /** Explicit list of fields to update. */ fieldMask?: string[]; } interface BulkUpdateBrandsResponse { /** * Brands updated by bulk action. * @maxSize 100 */ results?: BulkBrandsResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface GetOrCreateBrandRequest { /** * Brand name to retrieve or create. * @minLength 1 * @maxLength 50 */ brandName: string; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface GetOrCreateBrandResponse { /** Brand. */ brand?: Brand; } interface BulkGetOrCreateBrandsRequest { /** * Brand names to retrieve or create. * @minLength 1 * @maxLength 50 * @minSize 1 * @maxSize 100 */ brandNames: string[]; /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } interface BulkGetOrCreateBrandsResponse { /** * Brands retrieved or created by bulk action. * @maxSize 100 */ results?: BulkBrandsResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkDeleteBrandsRequest { /** * IDs of brands to delete. * @format GUID * @minSize 1 * @maxSize 100 */ brandIds: string[]; } interface BulkDeleteBrandsResponse { /** Brands deleted by bulk action. */ results?: BulkDeleteBrandsResponseBulkBrandsResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkDeleteBrandsResponseBulkBrandsResult { /** Bulk action metadata for brand. */ 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; } /** @docsIgnore */ type CreateBrandValidationErrors = { ruleName?: 'BRAND_LIMIT_EXCEEDED'; } | { ruleName?: 'ONLY_SPACES_STRING_ERROR'; }; /** @docsIgnore */ type BulkCreateBrandsValidationErrors = { ruleName?: 'BRAND_LIMIT_EXCEEDED'; } | { ruleName?: 'ONLY_SPACES_STRING_ERROR'; }; /** @docsIgnore */ type GetOrCreateBrandValidationErrors = { ruleName?: 'BRAND_LIMIT_EXCEEDED'; }; 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 BrandCreatedEnvelope { entity: Brand; metadata: EventMetadata; } /** * Triggered when a brand is created. * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @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 brands in catalog v3 (PII) * @permissionScopeId SCOPE.STORES.BRAND_READ_LIMITED * @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 Read brands in catalog v3 * @permissionScopeId SCOPE.STORES.BRAND_READ * @permissionScope Manage Orders * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS * @permissionId WIX_STORES.BRAND_READ * @webhook * @eventType wix.stores.catalog.v3.brand_created * @serviceIdentifier com.wix.stores.catalog.brand.v3.BrandService * @slug created */ declare function onBrandCreated(handler: (event: BrandCreatedEnvelope) => void | Promise): void; interface BrandDeletedEnvelope { metadata: EventMetadata; } /** * Triggered when a brand is deleted. * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @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 brands in catalog v3 (PII) * @permissionScopeId SCOPE.STORES.BRAND_READ_LIMITED * @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 Read brands in catalog v3 * @permissionScopeId SCOPE.STORES.BRAND_READ * @permissionScope Manage Orders * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS * @permissionId WIX_STORES.BRAND_READ * @webhook * @eventType wix.stores.catalog.v3.brand_deleted * @serviceIdentifier com.wix.stores.catalog.brand.v3.BrandService * @slug deleted */ declare function onBrandDeleted(handler: (event: BrandDeletedEnvelope) => void | Promise): void; interface BrandUpdatedEnvelope { entity: Brand; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** * Triggered when a brand is updated. * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @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 brands in catalog v3 (PII) * @permissionScopeId SCOPE.STORES.BRAND_READ_LIMITED * @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 Read brands in catalog v3 * @permissionScopeId SCOPE.STORES.BRAND_READ * @permissionScope Manage Orders * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS * @permissionId WIX_STORES.BRAND_READ * @webhook * @eventType wix.stores.catalog.v3.brand_updated * @serviceIdentifier com.wix.stores.catalog.brand.v3.BrandService * @slug updated */ declare function onBrandUpdated(handler: (event: BrandUpdatedEnvelope) => void | Promise): void; /** * Creates a brand. * @param brand - Brand to create. * @public * @requiredField brand * @requiredField brand.name * @permissionId WIX_STORES.BRAND_CREATE * @applicableIdentity APP * @returns Created brand. * @fqn com.wix.stores.catalog.brand.v3.BrandService.CreateBrand */ declare function createBrand(brand: NonNullablePaths): Promise & { __validationErrorsType?: CreateBrandValidationErrors; }>; /** * Retrieves a brand. * @param brandId - Brand ID. * @public * @requiredField brandId * @permissionId WIX_STORES.BRAND_READ * @applicableIdentity APP * @returns Brand. * @fqn com.wix.stores.catalog.brand.v3.BrandService.GetBrand */ declare function getBrand(brandId: string, options?: GetBrandOptions): Promise>; interface GetBrandOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Updates a brand. * * Each time the brand is updated, `revision` increments by 1. * The current `revision` must be passed when updating the brand. * This ensures you're working with the latest brand and prevents unintended overwrites. * @param _id - Brand ID. * @public * @requiredField _id * @requiredField brand * @requiredField brand.revision * @permissionId WIX_STORES.BRAND_UPDATE * @applicableIdentity APP * @returns Updated brand. * @fqn com.wix.stores.catalog.brand.v3.BrandService.UpdateBrand */ declare function updateBrand(_id: string, brand: NonNullablePaths, options?: UpdateBrandOptions): Promise>; interface UpdateBrand { /** * Brand ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the brand is updated. * To prevent conflicting changes, * the current revision must be passed when updating the brand. * * Ignored when creating a brand. * @readonly */ revision?: string | null; /** * Date and time the brand was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the brand was updated. * @readonly */ _updatedDate?: Date | null; /** * Brand name. * >**Note:** `name` must be unique. * @minLength 1 * @maxLength 50 */ name?: string; /** * Number of products this brand is assigned to. * > **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Brand API requests. * @readonly */ assignedProductsCount?: number | null; } interface UpdateBrandOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Deletes a brand. * * > **Note:** Deleting a brand will also remove it from all products it is assigned to. * @param brandId - Brand ID. * @public * @requiredField brandId * @permissionId WIX_STORES.BRAND_DELETE * @applicableIdentity APP * @fqn com.wix.stores.catalog.brand.v3.BrandService.DeleteBrand */ declare function deleteBrand(brandId: string): Promise; /** * Retrieves a list of up to 100 brands, 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.BRAND_READ * @applicableIdentity APP * @fqn com.wix.stores.catalog.brand.v3.BrandService.QueryBrands */ declare function queryBrands(options?: QueryBrandsOptions): BrandsQueryBuilder; interface QueryBrandsOptions { /** * 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 BrandsQueryResult extends QueryCursorResult { items: Brand[]; query: BrandsQueryBuilder; next: () => Promise; prev: () => Promise; } interface BrandsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => BrandsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => BrandsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ge: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => BrandsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ gt: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => BrandsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ le: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => BrandsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ lt: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => BrandsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. */ startsWith: (propertyName: '_id' | 'name', value: string) => BrandsQueryBuilder; /** @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[]) => BrandsQueryBuilder; in: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: any) => BrandsQueryBuilder; exists: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'name', value: boolean) => BrandsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ ascending: (...propertyNames: Array<'_createdDate' | '_updatedDate' | 'name'>) => BrandsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ descending: (...propertyNames: Array<'_createdDate' | '_updatedDate' | 'name'>) => BrandsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => BrandsQueryBuilder; /** @param cursor - A pointer to specific record */ skipTo: (cursor: string) => BrandsQueryBuilder; find: () => Promise; } /** * @hidden * @fqn com.wix.stores.catalog.brand.v3.BrandService.QueryBrands * @requiredField query */ declare function typedQueryBrands(query: BrandQuery, options?: QueryBrandsOptions): Promise>; interface BrandQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: ['_createdDate', '_updatedDate', 'name']; operators: '*'; sort: 'BOTH'; }, { fields: ['_id']; operators: '*'; sort: 'NONE'; } ]; } type CommonQueryWithEntityContext = Query; type BrandQuery = { /** 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: 300 */ 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: 5 */ 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 brands. * @param brands - Brands to create. * @public * @requiredField brands * @requiredField brands.name * @permissionId WIX_STORES.BRAND_CREATE * @applicableIdentity APP * @fqn com.wix.stores.catalog.brand.v3.BrandService.BulkCreateBrands */ declare function bulkCreateBrands(brands: NonNullablePaths[], options?: BulkCreateBrandsOptions): Promise & { __validationErrorsType?: BulkCreateBrandsValidationErrors; }>; interface BulkCreateBrandsOptions { /** * Whether to return the full created brand entities in the response. * * Default: `false` */ returnEntity?: boolean; } /** * Updates multiple brands. * * Each time a brand is updated, `revision` increments by 1. * The current `revision` must be passed when updating a brand. * This ensures you're working with the latest brand and prevents unintended overwrites. * @param brands - List of brands to update. * @public * @requiredField brands * @requiredField brands.brand._id * @requiredField brands.brand.revision * @permissionId WIX_STORES.BRAND_UPDATE * @applicableIdentity APP * @fqn com.wix.stores.catalog.brand.v3.BrandService.BulkUpdateBrands */ declare function bulkUpdateBrands(brands: NonNullablePaths[], options?: BulkUpdateBrandsOptions): Promise>; interface BulkUpdateBrandsOptions { /** * Whether to return the full updated brand 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 brand by name, or creates a brand if one with the passed `brandName` doesn't exist. * @param brandName - Brand name to retrieve or create. * @public * @requiredField brandName * @permissionId WIX_STORES.BRAND_GET_OR_CREATE * @applicableIdentity APP * @fqn com.wix.stores.catalog.brand.v3.BrandService.GetOrCreateBrand */ declare function getOrCreateBrand(brandName: string, options?: GetOrCreateBrandOptions): Promise & { __validationErrorsType?: GetOrCreateBrandValidationErrors; }>; interface GetOrCreateBrandOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Retrieves multiple brands by name, or creates multiple brands if those with the passed `brandNames` don't exist. * @param brandNames - Brand names to retrieve or create. * @public * @requiredField brandNames * @permissionId WIX_STORES.BRAND_GET_OR_CREATE * @applicableIdentity APP * @fqn com.wix.stores.catalog.brand.v3.BrandService.BulkGetOrCreateBrands */ declare function bulkGetOrCreateBrands(brandNames: string[], options?: BulkGetOrCreateBrandsOptions): Promise>; interface BulkGetOrCreateBrandsOptions { /** * Fields to include in the response. * * Supported values: `ASSIGNED_PRODUCTS_COUNT` * @maxSize 100 */ fields?: RequestedFieldsWithLiterals[]; } /** * Deletes multiple brands. * @param brandIds - IDs of brands to delete. * @public * @requiredField brandIds * @permissionId WIX_STORES.BRAND_DELETE * @applicableIdentity APP * @fqn com.wix.stores.catalog.brand.v3.BrandService.BulkDeleteBrands */ declare function bulkDeleteBrands(brandIds: string[]): Promise>; export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type App, type ApplicationError, type BaseEventMetadata, type Brand, type BrandCreatedEnvelope, type BrandDeletedEnvelope, type BrandQuery, type BrandQuerySpec, type BrandUpdatedEnvelope, type BrandsQueryBuilder, type BrandsQueryResult, type BulkActionMetadata, type BulkBrandsResult, type BulkCreateBrandsOptions, type BulkCreateBrandsRequest, type BulkCreateBrandsResponse, type BulkCreateBrandsValidationErrors, type BulkDeleteBrandsRequest, type BulkDeleteBrandsResponse, type BulkDeleteBrandsResponseBulkBrandsResult, type BulkGetOrCreateBrandsOptions, type BulkGetOrCreateBrandsRequest, type BulkGetOrCreateBrandsResponse, type BulkUpdateBrandsOptions, type BulkUpdateBrandsRequest, type BulkUpdateBrandsResponse, type CommonQueryWithEntityContext, type CreateBrandRequest, type CreateBrandResponse, type CreateBrandValidationErrors, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type DeleteBrandRequest, type DeleteBrandResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type File, type GetBrandOptions, type GetBrandRequest, type GetBrandResponse, type GetOrCreateBrandOptions, type GetOrCreateBrandRequest, type GetOrCreateBrandResponse, type GetOrCreateBrandValidationErrors, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type MaskedBrand, type MessageEnvelope, type Page, type Pages, type QueryBrandsOptions, type QueryBrandsRequest, type QueryBrandsResponse, type RecloneSiteRequest, type RecloneSiteResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type URI, type URIs, type UpdateBrand, type UpdateBrandOptions, type UpdateBrandRequest, type UpdateBrandResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateBrands, bulkDeleteBrands, bulkGetOrCreateBrands, bulkUpdateBrands, createBrand, deleteBrand, getBrand, getOrCreateBrand, onBrandCreated, onBrandDeleted, onBrandUpdated, queryBrands, typedQueryBrands, updateBrand, utils };