import { CreateBadgeRequest as CreateBadgeRequest$1, CreateBadgeResponse as CreateBadgeResponse$1, GetBadgeRequest as GetBadgeRequest$1, GetBadgeResponse as GetBadgeResponse$1, QueryBadgesRequest as QueryBadgesRequest$1, QueryBadgesResponse as QueryBadgesResponse$1, UpdateBadgeRequest as UpdateBadgeRequest$1, UpdateBadgeResponse as UpdateBadgeResponse$1, DeleteBadgeRequest as DeleteBadgeRequest$1, DeleteBadgeResponse as DeleteBadgeResponse$1, UpdateBadgesDisplayOrderRequest as UpdateBadgesDisplayOrderRequest$1, UpdateBadgesDisplayOrderResponse as UpdateBadgesDisplayOrderResponse$1, MoveBadgeRequest as MoveBadgeRequest$1, MoveBadgeResponse as MoveBadgeResponse$1 } from './index.typings.js'; import '@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?: Image; /** * 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 Image { /** [WixMedia](https://support.wix.com/en/article/wix-media-about-the-media-manager) image ID. If you pass the ID, you don't need to pass `url`. */ id?: string; /** Image URL. Could be any image from the internet. */ url?: string; /** * Original image height. * @readonly */ height?: number; /** * Original image width. * @readonly */ width?: number; /** Image alt text. */ altText?: string | null; /** * Image filename. Only applicable when passing `id`. * @readonly */ filename?: string | 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?: Image; /** * 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 { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } 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. */ currentEntityAsJson?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntityAsJson?: string | null; } interface ActionEvent { bodyAsJson?: 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'; }; type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function createBadge(): __PublicMethodMetaInfo<'POST', {}, CreateBadgeRequest$1, CreateBadgeRequest, CreateBadgeResponse$1, CreateBadgeResponse>; declare function getBadge(): __PublicMethodMetaInfo<'GET', { badgeId: string; }, GetBadgeRequest$1, GetBadgeRequest, GetBadgeResponse$1, GetBadgeResponse>; declare function queryBadges(): __PublicMethodMetaInfo<'POST', {}, QueryBadgesRequest$1, QueryBadgesRequest, QueryBadgesResponse$1, QueryBadgesResponse>; declare function updateBadge(): __PublicMethodMetaInfo<'PATCH', { badgeId: string; }, UpdateBadgeRequest$1, UpdateBadgeRequest, UpdateBadgeResponse$1, UpdateBadgeResponse>; declare function deleteBadge(): __PublicMethodMetaInfo<'DELETE', { badgeId: string; }, DeleteBadgeRequest$1, DeleteBadgeRequest, DeleteBadgeResponse$1, DeleteBadgeResponse>; declare function updateBadgesDisplayOrder(): __PublicMethodMetaInfo<'POST', {}, UpdateBadgesDisplayOrderRequest$1, UpdateBadgesDisplayOrderRequest, UpdateBadgesDisplayOrderResponse$1, UpdateBadgesDisplayOrderResponse>; declare function moveBadge(): __PublicMethodMetaInfo<'POST', { badgeId: string; }, MoveBadgeRequest$1, MoveBadgeRequest, MoveBadgeResponse$1, MoveBadgeResponse>; export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type Badge as BadgeOriginal, type CreateBadgeRequest as CreateBadgeRequestOriginal, type CreateBadgeResponse as CreateBadgeResponseOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type CursorQuery as CursorQueryOriginal, type CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOfOriginal, type Cursors as CursorsOriginal, type DeleteBadgeRequest as DeleteBadgeRequestOriginal, type DeleteBadgeResponse as DeleteBadgeResponseOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type Empty as EmptyOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type GetBadgeRequest as GetBadgeRequestOriginal, type GetBadgeResponse as GetBadgeResponseOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type Image as ImageOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type MigrationBadgeCreated as MigrationBadgeCreatedOriginal, type MigrationBadge as MigrationBadgeOriginal, type MigrationBadgeUpdated as MigrationBadgeUpdatedOriginal, type MoveBadgeRequest as MoveBadgeRequestOriginal, type MoveBadgeResponse as MoveBadgeResponseOriginal, type PagingMetadata as PagingMetadataOriginal, type Paging as PagingOriginal, Position as PositionOriginal, type PositionWithLiterals as PositionWithLiteralsOriginal, type QueryBadgesLegacyRequest as QueryBadgesLegacyRequestOriginal, type QueryBadgesLegacyResponse as QueryBadgesLegacyResponseOriginal, type QueryBadgesRequest as QueryBadgesRequestOriginal, type QueryBadgesResponse as QueryBadgesResponseOriginal, type RestoreInfo as RestoreInfoOriginal, SortOrder as SortOrderOriginal, type SortOrderWithLiterals as SortOrderWithLiteralsOriginal, type Sorting as SortingOriginal, type UpdateBadgeRequest as UpdateBadgeRequestOriginal, type UpdateBadgeResponse as UpdateBadgeResponseOriginal, type UpdateBadgeValidationErrors as UpdateBadgeValidationErrorsOriginal, type UpdateBadgesDisplayOrderRequest as UpdateBadgesDisplayOrderRequestOriginal, type UpdateBadgesDisplayOrderResponse as UpdateBadgesDisplayOrderResponseOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, createBadge, deleteBadge, getBadge, moveBadge, queryBadges, updateBadge, updateBadgesDisplayOrder };