import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; /** * A badge is a visible label displayed on a site member's profile. * * Site owners can create badges to categorize members and optionally grant them special permissions to access specific pages. * * Badges are managed separately from their assignment to members. To assign badges to members, use the [Badge Assignments](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/activity/badge-assignments/introduction) API. * * For more information, see [Creating and Managing Member Badges](https://support.wix.com/en/article/site-members-creating-and-managing-member-badges). */ interface Badge { /** * Badge ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the badge is updated. To prevent conflicting changes, the current revision must be passed when updating the badge. * @readonly */ revision?: string | null; /** * Badge title displayed on the member's profile. * @minLength 1 * @maxLength 50 */ title?: string | null; /** * Badge description explaining its purpose or criteria for earning it. * @maxLength 1500 */ description?: string | null; /** * Badge background color in hexadecimal RGB format. * @format COLOR_HEX */ backgroundColor?: string | null; /** * Badge text color in hexadecimal RGB format. * @format COLOR_HEX */ textColor?: string | null; /** * Badge icon image. * * Any image format is accepted with automatic conversion and resizing handled by the system. * SVG format is recommended as it is resolution independent and looks great at any scale. */ icon?: string; /** * Whether the badge grants special permissions to access specific members-only pages. * * When `true`, members with this badge receive special permissions. * Site owners can configure these permissions in the site dashboard. For more information, see [Creating and Managing Member Badges](https://support.wix.com/en/article/site-members-creating-and-managing-member-badges). */ permissionsEnabled?: boolean | null; /** * URL-friendly slug for the badge, automatically generated from the title. * * Generated by converting the title to lowercase, replacing spaces with hyphens, and removing special characters. * @readonly * @minLength 1 * @maxLength 255 */ slug?: string | null; /** * Date and time the badge was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the badge was last updated. * @readonly */ _updatedDate?: Date | null; } interface MigrationBadgeUpdated { migrationBadge?: MigrationBadge; } interface MigrationBadge { /** * Badge ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the Badge is updated. * To prevent conflicting changes, * the current revision must be passed when updating the Badge. * Ignored when creating a Badge. * @readonly */ revision?: string | null; /** * Text displayed on the badge in the Wix UI. * @minLength 1 * @maxLength 50 */ title?: string | null; /** * Badge description. * @maxLength 1500 */ description?: string | null; /** * Badge background color in hexadecimal RGB format. * Uppercase letters only. * Example: `#FFFFFF`. * @format COLOR_HEX */ backgroundColor?: string | null; /** * Badge text color in hexadecimal RGB format. * Uppercase letters only. * Example: `#C81B53`. * @format COLOR_HEX */ textColor?: string | null; /** * Badge icon image. * _Recommended_ to use `SVG` image format as it is resolution independent and looks great at any scale. */ icon?: string; /** * Whether the badge has special permissions * to access specific members-only pages. * When `true`, members with the badge receive special permissions, * and site contributors can * [manage badge permissions](https://support.wix.com/en/article/setting-permissions-for-a-member-badge) * in the site dashboard. * When `false`, members with the badge receive no special permissions. */ permissionsEnabled?: boolean | null; /** * Slugified name. Used to represent the badge in a URL. * @readonly * @minLength 1 * @maxLength 255 */ slug?: string | null; /** * Date and time the Badge was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the Badge was last updated. * @readonly */ _updatedDate?: Date | null; /** * Order rank of the badge in the site * @readonly */ orderRank?: number | null; } interface MigrationBadgeCreated { migrationBadge?: MigrationBadge; } interface CreateBadgeRequest { /** Badge to create. */ badge: Badge; } interface CreateBadgeResponse { /** Created badge. */ badge?: Badge; } interface GetBadgeRequest { /** * Badge ID. * @format GUID */ badgeId: string; } interface GetBadgeResponse { /** Retrieved badge. */ badge?: Badge; } interface QueryBadgesRequest { /** Query options including filters, sorting, and paging. */ query?: CursorQuery; } interface CursorQuery extends CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ 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. */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface CursorPaging { /** * Number of items to load. * @max 100 */ 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 QueryBadgesResponse { /** List of badges matching the query criteria. */ badges?: Badge[]; /** Paging metadata for retrieving additional results. */ pagingMetadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ cursors?: Cursors; /** * Indicates if there are more results after the current page. * If `true`, another page of results can be retrieved. * If `false`, this is the last page. */ hasNext?: boolean | null; } interface Cursors { /** Cursor pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } interface QueryBadgesLegacyRequest { /** Filter criteria */ filter?: Record | null; /** * Sorting criteria * @maxSize 1000 */ sort?: Sorting[]; /** Result paging data */ paging?: Paging; } interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface QueryBadgesLegacyResponse { /** List of sorted badges in a site that satisfy filter and paging */ badges?: Badge[]; /** Total count of badges in a site that satisfy given filter */ metadata?: PagingMetadata; } interface PagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; } interface UpdateBadgeRequest { /** Badge to update. Must include ID and revision to prevent conflicts. */ badge: Badge; } interface UpdateBadgeResponse { /** Updated badge with incremented revision and updated timestamp. */ badge?: Badge; } interface DeleteBadgeRequest { /** * Badge ID. * @format GUID */ badgeId: string; } interface DeleteBadgeResponse { } interface UpdateBadgesDisplayOrderRequest { /** * Ordered list of badge IDs. * @format GUID * @minSize 1 * @maxSize 100 */ ids: string[]; } interface UpdateBadgesDisplayOrderResponse { /** Badges in their new display order. */ badges?: Badge[]; } interface MoveBadgeRequest { /** * ID of the badge to move. * @format GUID */ badgeId: string; /** Target position for the badge. */ position?: PositionWithLiterals; /** * ID of the badge after which to position your badge. * @format GUID */ moveAfterBadgeId?: string | null; } declare enum Position { /** Position the badge at the end of the display sequence. */ LAST = "LAST", /** Position the badge at the beginning of the display sequence. */ FIRST = "FIRST", /** * Position the badge after another specific badge. * In this case you need to specify `moveAfterBadgeId`. */ AFTER = "AFTER" } /** @enumType */ type PositionWithLiterals = Position | 'LAST' | 'FIRST' | 'AFTER'; interface MoveBadgeResponse { } 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 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 UpdateBadgeValidationErrors = { ruleName?: 'BADGE_NOT_PROVIDED'; }; 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 BadgeCreatedEnvelope { entity: Badge; metadata: EventMetadata; } /** * Triggered when a badge is created. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Challenges * @permissionScopeId SCOPE.CHALLENGES.MANAGE * @permissionScope Manage Badges * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-BADGES * @permissionScope Read Badges * @permissionScopeId SCOPE.DC-MEMBERS.READ-BADGES * @permissionId BADGES.BADGE_READ * @webhook * @eventType wix.badges.v4.badge_created * @serviceIdentifier wix.badges.v4.Badges * @slug created * @documentationMaturity preview */ declare function onBadgeCreated(handler: (event: BadgeCreatedEnvelope) => void | Promise): void; interface BadgeDeletedEnvelope { metadata: EventMetadata; } /** * Triggered when a badge is deleted. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Challenges * @permissionScopeId SCOPE.CHALLENGES.MANAGE * @permissionScope Manage Badges * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-BADGES * @permissionScope Read Badges * @permissionScopeId SCOPE.DC-MEMBERS.READ-BADGES * @permissionId BADGES.BADGE_READ * @webhook * @eventType wix.badges.v4.badge_deleted * @serviceIdentifier wix.badges.v4.Badges * @slug deleted * @documentationMaturity preview */ declare function onBadgeDeleted(handler: (event: BadgeDeletedEnvelope) => void | Promise): void; interface BadgeUpdatedEnvelope { entity: Badge; metadata: EventMetadata; } /** * Triggered when a badge is updated. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Challenges * @permissionScopeId SCOPE.CHALLENGES.MANAGE * @permissionScope Manage Badges * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-BADGES * @permissionScope Read Badges * @permissionScopeId SCOPE.DC-MEMBERS.READ-BADGES * @permissionId BADGES.BADGE_READ * @webhook * @eventType wix.badges.v4.badge_updated * @serviceIdentifier wix.badges.v4.Badges * @slug updated * @documentationMaturity preview */ declare function onBadgeUpdated(handler: (event: BadgeUpdatedEnvelope) => void | Promise): void; /** * Creates a badge. * @param badge - Badge to create. * @public * @documentationMaturity preview * @requiredField badge * @requiredField badge.backgroundColor * @requiredField badge.textColor * @requiredField badge.title * @permissionId BADGES.BADGE_CREATE * @applicableIdentity APP * @returns Created badge. * @fqn wix.badges.v4.Badges.CreateBadge */ declare function createBadge(badge: NonNullablePaths): Promise; /** * Retrieves a badge by ID. * @param badgeId - Badge ID. * @public * @documentationMaturity preview * @requiredField badgeId * @permissionId BADGES.BADGE_READ * @applicableIdentity APP * @returns Retrieved badge. * @fqn wix.badges.v4.Badges.GetBadge */ declare function getBadge(badgeId: string): Promise; /** * Creates a query to retrieve a list of badges. * * The `queryBadges()` method builds a query to retrieve a list of badges and returns a `BadgesQueryBuilder` object. * * The returned object contains the query definition, which is typically used to run the query using the `find()` method. * * You can refine the query by chaining `BadgesQueryBuilder` methods onto the query. `BadgesQueryBuilder` methods enable you to sort, filter, and control the results `queryBadges()` returns. * * `queryBadges()` runs with these `BadgesQueryBuilder` defaults, which you can override: * * - limit(50) * - descending("_createdDate") * * The methods that are chained to `queryBadges()` are applied in the order they're called. For example, if you apply ascending('title') and then descending('id'), the results are sorted first by the title, and then, if there are multiple results with the same title, the items are sorted by ID. * @public * @documentationMaturity preview * @permissionId BADGES.BADGE_READ * @applicableIdentity APP * @fqn wix.badges.v4.Badges.QueryBadges */ declare function queryBadges(): BadgesQueryBuilder; interface QueryOffsetResult { currentPage: number | undefined; totalPages: number | undefined; totalCount: number | undefined; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface BadgesQueryResult extends QueryOffsetResult { items: Badge[]; query: BadgesQueryBuilder; next: () => Promise; prev: () => Promise; } interface BadgesQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id' | 'title' | 'description' | 'permissionsEnabled' | 'slug', value: any) => BadgesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id' | 'title' | 'description' | 'permissionsEnabled' | 'slug', value: any) => BadgesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ge: (propertyName: '_id' | 'title' | 'description' | 'slug', value: any) => BadgesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ gt: (propertyName: '_id' | 'title' | 'description' | 'slug', value: any) => BadgesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ le: (propertyName: '_id' | 'title' | 'description' | 'slug', value: any) => BadgesQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ lt: (propertyName: '_id' | 'title' | 'description' | 'slug', value: any) => BadgesQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. * @documentationMaturity preview */ startsWith: (propertyName: '_id' | 'title' | 'description' | 'slug', value: string) => BadgesQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. * @documentationMaturity preview */ hasSome: (propertyName: '_id' | 'title' | 'description' | 'permissionsEnabled' | 'slug', value: any[]) => BadgesQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id' | 'title' | 'description' | 'permissionsEnabled' | 'slug', value: any) => BadgesQueryBuilder; /** @documentationMaturity preview */ exists: (propertyName: '_id' | 'title' | 'description' | 'permissionsEnabled' | 'slug', value: boolean) => BadgesQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'_id' | 'title' | 'description' | 'permissionsEnabled' | 'slug'>) => BadgesQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => BadgesQueryBuilder; /** @param skip - Number of items to skip in the query results before returning the results. * @documentationMaturity preview */ skip: (skip: number) => BadgesQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * @hidden * @fqn wix.badges.v4.Badges.QueryBadges * @requiredField query */ declare function typedQueryBadges(query: BadgeQuery): Promise>; interface BadgeQuerySpec extends QuerySpec { paging: 'offset'; wql: [ { fields: ['_id', 'description', 'permissionsEnabled', 'slug', 'title']; operators: '*'; sort: 'ASC'; } ]; } type CommonQueryWithEntityContext = Query; type BadgeQuery = { /** 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"}]` */ sort?: { /** Name of the field to sort by. */ 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; }; }; /** * Updates a badge. * @param _id - Badge ID. * @public * @documentationMaturity preview * @requiredField _id * @requiredField badge * @permissionId BADGES.BADGE_UPDATE * @applicableIdentity APP * @returns Updated badge with incremented revision and updated timestamp. * @fqn wix.badges.v4.Badges.UpdateBadge */ declare function updateBadge(_id: string, badge: UpdateBadge): Promise; interface UpdateBadge { /** * Badge ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the badge is updated. To prevent conflicting changes, the current revision must be passed when updating the badge. * @readonly */ revision?: string | null; /** * Badge title displayed on the member's profile. * @minLength 1 * @maxLength 50 */ title?: string | null; /** * Badge description explaining its purpose or criteria for earning it. * @maxLength 1500 */ description?: string | null; /** * Badge background color in hexadecimal RGB format. * @format COLOR_HEX */ backgroundColor?: string | null; /** * Badge text color in hexadecimal RGB format. * @format COLOR_HEX */ textColor?: string | null; /** * Badge icon image. * * Any image format is accepted with automatic conversion and resizing handled by the system. * SVG format is recommended as it is resolution independent and looks great at any scale. */ icon?: string; /** * Whether the badge grants special permissions to access specific members-only pages. * * When `true`, members with this badge receive special permissions. * Site owners can configure these permissions in the site dashboard. For more information, see [Creating and Managing Member Badges](https://support.wix.com/en/article/site-members-creating-and-managing-member-badges). */ permissionsEnabled?: boolean | null; /** * URL-friendly slug for the badge, automatically generated from the title. * * Generated by converting the title to lowercase, replacing spaces with hyphens, and removing special characters. * @readonly * @minLength 1 * @maxLength 255 */ slug?: string | null; /** * Date and time the badge was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the badge was last updated. * @readonly */ _updatedDate?: Date | null; } /** * Deletes a badge. * * Deleting a badge will remove it from all members who currently have it assigned. * @param badgeId - Badge ID. * @public * @documentationMaturity preview * @requiredField badgeId * @permissionId BADGES.BADGE_DELETE * @applicableIdentity APP * @fqn wix.badges.v4.Badges.DeleteBadge */ declare function deleteBadge(badgeId: string): Promise; /** * Updates the display order of badges. * * Provide an ordered array of badge IDs to set their display sequence. * * This affects how badges appear to site members and in the site dashboard. * @param ids - Ordered list of badge IDs. * @public * @documentationMaturity preview * @requiredField ids * @permissionId BADGES.BADGE_UPDATE_DISPLAY_ORDER * @applicableIdentity APP * @fqn wix.badges.v4.Badges.UpdateBadgesDisplayOrder * @deprecated * @replacedBy wix.badges.v4.Badges.MoveBadge * @targetRemovalDate 2026-07-01 */ declare function updateBadgesDisplayOrder(ids: string[]): Promise>; /** * Moves a badge to a specific position in the display order. * * You can position a badge first, last, or immediately after another badge. * * This affects how badges appear to site members and in the site dashboard. * @param badgeId - ID of the badge to move. * @public * @documentationMaturity preview * @requiredField badgeId * @permissionId BADGES.BADGE_UPDATE_DISPLAY_ORDER * @applicableIdentity APP * @fqn wix.badges.v4.Badges.MoveBadge */ declare function moveBadge(badgeId: string, options?: MoveBadgeOptions): Promise; interface MoveBadgeOptions { /** Target position for the badge. */ position?: PositionWithLiterals; /** * ID of the badge after which to position your badge. * @format GUID */ moveAfterBadgeId?: string | null; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type Badge, type BadgeCreatedEnvelope, type BadgeDeletedEnvelope, type BadgeQuery, type BadgeQuerySpec, type BadgeUpdatedEnvelope, type BadgesQueryBuilder, type BadgesQueryResult, type BaseEventMetadata, type CommonQueryWithEntityContext, type CreateBadgeRequest, type CreateBadgeResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteBadgeRequest, type DeleteBadgeResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetBadgeRequest, type GetBadgeResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type MigrationBadge, type MigrationBadgeCreated, type MigrationBadgeUpdated, type MoveBadgeOptions, type MoveBadgeRequest, type MoveBadgeResponse, type Paging, type PagingMetadata, Position, type PositionWithLiterals, type QueryBadgesLegacyRequest, type QueryBadgesLegacyResponse, type QueryBadgesRequest, type QueryBadgesResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type UpdateBadge, type UpdateBadgeRequest, type UpdateBadgeResponse, type UpdateBadgeValidationErrors, type UpdateBadgesDisplayOrderRequest, type UpdateBadgesDisplayOrderResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createBadge, deleteBadge, getBadge, moveBadge, onBadgeCreated, onBadgeDeleted, onBadgeUpdated, queryBadges, typedQueryBadges, updateBadge, updateBadgesDisplayOrder, utils };