import { NonNullablePaths } from '@wix/sdk-types'; /** * A group member may have multiple roles in a single group. * Currently, only `MEMBER` and `ADMIN` roles are supported, but more roles may be available in the future. */ interface GroupRole { /** Member's role. */ value?: RoleWithLiterals; } declare enum Role { /** Regular group member. */ MEMBER = "MEMBER", /** Group administrator. */ ADMIN = "ADMIN" } /** @enumType */ type RoleWithLiterals = Role | 'MEMBER' | 'ADMIN'; interface AssignRoleRequest { /** * Group ID. * @format GUID */ groupId: string; /** * Member IDs. Limited to 100 member IDs. See the Members API for details. * @format GUID * @maxSize 100 */ memberIds?: string[]; /** Role to assign. */ role?: GroupRole; } interface AssignRoleResponse { /** * Group ID. * @format GUID */ groupId?: string; /** * Member IDs. Limited to 100 member IDs. See the Members API for details. * @format GUID * @maxSize 100 */ memberIds?: string[]; /** Assigned role. */ role?: GroupRole; } interface RoleAssignedToGroupMember { /** * Group ID in which role was assigned. * @format GUID */ groupId?: string; /** Group member to whom the role was assigned. */ groupMember?: GroupMember; /** Assigned group role. */ role?: GroupRole; /** * ID of site member who assigned the role. It can be empty if the role was assigned by a third-party application. * @format GUID */ assignedById?: string | null; } /** * A group member represents an existing site member that has joined a group. * You can add, remove, and query group members. * Learn more about [group members](https://support.wix.com/en/article/wix-groups-adding-new-members-to-your-group). */ interface GroupMember { /** * Member ID. See the Members API for more details. * @readonly * @format GUID */ memberId?: string; /** Group member role. */ role?: GroupRole; /** * Date and time the group Member joined the group. * @readonly */ joinedDate?: Date | null; } interface UnassignRoleRequest { /** * Group ID. * @format GUID */ groupId: string; /** * Member IDs. Limited to 100 member IDs. See the Members API for details. * @format GUID * @maxSize 100 */ memberIds?: string[]; /** Role to unassign. */ role?: GroupRole; } interface UnassignRoleResponse { /** * Group ID. * @format GUID */ groupId?: string; /** * @internal * @internal * @format GUID * @maxSize 100 * @deprecated */ siteMemberIds?: string[]; /** * Member IDs. Limited to 100 member IDs. See the Members API for details. * @format GUID * @maxSize 100 */ memberIds?: string[]; /** Unassigned role. */ role?: GroupRole; } interface RoleUnassignedFromGroupMember { /** * Group ID in which role was unassigned. * @format GUID */ groupId?: string; /** Group member from whom role was removed. */ groupMember?: GroupMember; /** Unassigned group role. */ role?: GroupRole; /** * ID of site member who unassigned the role. It can be empty if the role was assigned by a third-party application. * @format GUID */ unassignedById?: string | null; } 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 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 GroupRoleAssignedEnvelope { data: RoleAssignedToGroupMember; metadata: EventMetadata; } /** * Triggered when a role is assigned to an existing group member. * @webhook * @eventType wix.social_groups.v2.group_role_assigned * @serviceIdentifier wix.social.groups.api.v2.GroupRolesService * @slug assigned */ declare function onGroupRoleAssigned(handler: (event: GroupRoleAssignedEnvelope) => void | Promise): void; interface GroupRoleUnassignedEnvelope { data: RoleUnassignedFromGroupMember; metadata: EventMetadata; } /** * Triggered when a role is unassigned from a group member. * @webhook * @eventType wix.social_groups.v2.group_role_unassigned * @serviceIdentifier wix.social.groups.api.v2.GroupRolesService * @slug unassigned */ declare function onGroupRoleUnassigned(handler: (event: GroupRoleUnassignedEnvelope) => void | Promise): void; /** * Assigns a specific role to group members. * * Calling this method overrides the group member's current `role.value`. * * >**Notes:** * > + Only group admins can assign roles. * > + You cannot create new members with this method. * @param groupId - Group ID. * @param memberIds - Member IDs. Limited to 100 member IDs. See the Members API for details. * @param role - Role to assign. * @public * @requiredField groupId * @requiredField memberIds * @requiredField role * @fqn wix.social.groups.api.v2.GroupRolesService.AssignRole */ declare function assignRole(groupId: string, memberIds: string[], role: GroupRole): Promise>; /** * Unassigns a role from group members. * * You can only unassign `ADMIN` roles. Calling this method with group members * with `role.value` set to `MEMBER` returns an error. * * > **Notes:** * > + Only group admins can assign roles. * > + You cannot remove members with this method. * @param groupId - Group ID. * @param memberIds - Member IDs. Limited to 100 member IDs. See the Members API for details. * @param role - Role to unassign. * @public * @requiredField groupId * @requiredField memberIds * @requiredField role * @fqn wix.social.groups.api.v2.GroupRolesService.UnassignRole */ declare function unassignRole(groupId: string, memberIds: string[], role: GroupRole): Promise>; export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AssignRoleRequest, type AssignRoleResponse, type BaseEventMetadata, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GroupMember, type GroupRole, type GroupRoleAssignedEnvelope, type GroupRoleUnassignedEnvelope, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type RestoreInfo, Role, type RoleAssignedToGroupMember, type RoleUnassignedFromGroupMember, type RoleWithLiterals, type UnassignRoleRequest, type UnassignRoleResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, assignRole, onGroupRoleAssigned, onGroupRoleUnassigned, unassignRole };