import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query as Query$1, NonNullablePaths } from '@wix/sdk-types'; /** * A group object represents a community space where site members can connect and share content. * You can create groups and manage their visibility, settings, and metadata. * Learn more about [groups](https://support.wix.com/en/article/wix-groups-about-groups). */ interface Group { /** * Group ID. * @readonly * @format GUID */ _id?: string | null; /** * A unique part of a group's URL, for example `https:/example.com/groups/slug`. * @minLength 1 * @maxLength 100 */ slug?: string | null; /** Group privacy status. */ privacyStatus?: PrivacyStatusWithLiterals; /** * Group name. * @maxLength 100 */ name?: string | null; /** * Group description in [DraftJS](https://draftjs.org) format. * @maxLength 20480 */ description?: string | null; /** * Group teaser. * @maxLength 1000 */ teaser?: string | null; /** * What group members are called, for example `Coworkers`, `Friends`, or `Students`. * @minLength 1 * @maxLength 1000 */ memberTitle?: string | null; /** Cover image. You cannot upload your own cover image. */ coverImage?: CoverImage; /** * Group specific settings. * * These settings can also be found in [a site's Dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fwix-groups/settings?). */ settings?: GroupSettings; /** * Total count of current group members. * @readonly */ membersCount?: number | null; /** * Group owner. * @readonly * @format GUID */ ownerId?: string | null; /** * Group creation date and time. * @readonly */ _createdDate?: Date | null; /** * Date and time of the latest group update. * @readonly */ _updatedDate?: Date | null; /** * Date and time of the most recent group activity, for example a post or comment. * @readonly */ lastActivityDate?: Date | null; } declare enum Type { UNKNOWN = "UNKNOWN", ADMIN_APPROVAL = "ADMIN_APPROVAL", PAID_PLANS = "PAID_PLANS", EVENTS = "EVENTS" } /** @enumType */ type TypeWithLiterals = Type | 'UNKNOWN' | 'ADMIN_APPROVAL' | 'PAID_PLANS' | 'EVENTS'; interface Events { /** @format GUID */ eventIds?: string[]; } interface Logo { /** * Logo image ID (for internal use). * @maxLength 1000 */ mediaId?: string | null; /** Logo image width. */ width?: number | null; /** Logo image height. */ height?: number | null; /** * Alternative text. * @maxLength 200 */ altText?: string | null; } interface GroupDetailsPosition { /** horizontal coordinate */ x?: number; /** vertical coordinate */ y?: number; } interface Image { /** * Image ID (for internal use). * @maxLength 1000 */ mediaId?: string | null; /** Image width. */ width?: number | null; /** Image height. */ height?: number | null; /** Indicates pre-configured/auto-generated images (from templates, client generated). */ preset?: boolean | null; } interface Position { /** horizontal coordinate */ x?: number; /** vertical coordinate */ y?: number; } declare enum AllowPolicy { UNKNOWN = "UNKNOWN", OWNER_AND_ADMINS = "OWNER_AND_ADMINS", OWNER = "OWNER", ALL_MEMBERS = "ALL_MEMBERS" } /** @enumType */ type AllowPolicyWithLiterals = AllowPolicy | 'UNKNOWN' | 'OWNER_AND_ADMINS' | 'OWNER' | 'ALL_MEMBERS'; interface OnboardingStepSettings { stepKey?: StepKeyWithLiterals; visible?: boolean; } declare enum StepKey { UNKNOWN = "UNKNOWN", CREATE_POST = "CREATE_POST", REACT_TO_POST = "REACT_TO_POST", INVITE_MEMBERS = "INVITE_MEMBERS" } /** @enumType */ type StepKeyWithLiterals = StepKey | 'UNKNOWN' | 'CREATE_POST' | 'REACT_TO_POST' | 'INVITE_MEMBERS'; declare enum PrivacyStatus { /** Undefined group privacy status. */ UNKNOWN = "UNKNOWN", /** Anyone can see the group and its content. Anyone can join the group. */ PUBLIC = "PUBLIC", /** Anyone can see the group, but only members can see its content. New members must submit a `Join Group Request`. */ PRIVATE = "PRIVATE", /** Only admins and members can see the group. New members can only be added by other members. */ SECRET = "SECRET" } /** @enumType */ type PrivacyStatusWithLiterals = PrivacyStatus | 'UNKNOWN' | 'PUBLIC' | 'PRIVATE' | 'SECRET'; interface AccessRestriction extends AccessRestrictionDataOneOf { events?: Events; type?: TypeWithLiterals; } /** @oneof */ interface AccessRestrictionDataOneOf { events?: Events; } interface GroupDetails { /** Group logo. You cannot upload your own logo. */ logo?: Logo; /** * What group members are called, for example `Coworkers`, `Friends`, or `Students`. * @minLength 1 * @maxLength 1000 */ membersTitle?: string | null; } /** Cover image. You cannot upload your own cover image. */ interface CoverImage { /** Cover image. */ image?: Image; /** Position of the corner of the cover image (or logo). */ position?: Position; /** Position of the corner of the cover image (or logo) for mobile browser. */ mobilePosition?: Position; /** * Alternative text is typically a relatively short phrase that describes what the image depicts. * * The alternative text is used: * + If the browser cannot display the image. * + If the user is utilizing a screen reader. * + By search engines to understand what images are on your site. * @maxLength 200 */ altText?: string | null; } interface GroupSettings { /** * __Deprecated.__ Use `allowedToInviteMembers` instead. * Whether regular members are permitted to invite new members. * If `false`, only admins can invite members. Defaults to `true`. * @deprecated */ membersCanInvite?: boolean | null; /** * __Deprecated.__ Use `allowedToApproveJoinRequests` instead. * Whether all group members are permitted to approve join group requests. * If `false`, member approval is limited to the admins. * @deprecated */ membersCanApprove?: boolean | null; /** Whether a daily post about new members is enabled. */ welcomeMemberPostEnabled?: boolean | null; /** Whether an automatic post about changing the group details is enabled. */ groupDetailsChangedPostEnabled?: boolean | null; /** Whether all members can see the full member list. */ showMemberList?: boolean | null; /** Determines who can invite members to the group */ allowedToInviteMembers?: AllowPolicyWithLiterals; /** Determines who can approve member join requests to the group */ allowedToApproveJoinRequests?: AllowPolicyWithLiterals; /** * Whether AI spam protection is enabled for post creation in the group. * If not explicitly set, the default behavior is 'true' (enabled). */ aiSpamProtectionEnabled?: boolean | null; } interface Identity { /** * Member ID of the group creator. See the Members API for more details. * @format GUID */ _id?: string | null; identityType?: IdentityTypeWithLiterals; } declare enum IdentityType { /** Wix user. */ USER = "USER", /** Wix member. */ MEMBER = "MEMBER" } /** @enumType */ type IdentityTypeWithLiterals = IdentityType | 'USER' | 'MEMBER'; interface CreateGroupRequest { /** Group to create. */ group: Group; /** * ID of the member who created the group, from the Members API. This member will automatically become an admin. * @format GUID */ creatorId?: string | null; /** Content type. */ contentType?: ContentTypeWithLiterals; } declare enum ContentType { PLAIN_TEXT = "PLAIN_TEXT", DRAFTJS = "DRAFTJS", RICH_CONTENT = "RICH_CONTENT" } /** @enumType */ type ContentTypeWithLiterals = ContentType | 'PLAIN_TEXT' | 'DRAFTJS' | 'RICH_CONTENT'; interface CreateGroupResponse { /** Created group. */ group?: Group; } interface UpdateGroupRequest { /** Group to update. */ group: Group; /** Content type. */ contentType?: ContentTypeWithLiterals; } interface UpdateGroupResponse { /** Updated group. */ group?: Group; } interface GroupCoverChanged { /** Old URL of group cover. */ oldUrl?: string | null; /** New URL of group cover. */ newUrl?: string | null; } interface GroupDescriptionChanged { /** Group's old description. */ oldDescription?: string | null; /** Group's new description. */ newDescription?: string | null; } interface DeleteGroupRequest { /** * ID of the group to delete. * @format GUID */ groupId: string; } interface DeleteGroupResponse { /** Deleted group. */ group?: Group; } interface GetGroupRequest { /** * ID of the group to retrieve. * @format GUID */ groupId: string; /** Content type. */ contentType?: ContentTypeWithLiterals; } interface GetGroupResponse { /** Retrieved group. */ group?: Group; } interface GetGroupBySlugRequest { /** * Unique part of the group's URL. For example, if a group's URL is `https:/example.com/groups/{my-fitness-group}`, the slug is `my-fitness-group`. Case-sensitive. * @minLength 1 * @maxLength 100 */ slug: string; /** @format GUID */ autoInviteId?: string | null; /** Content type. */ contentType?: ContentTypeWithLiterals; } interface GetGroupBySlugResponse { /** Retrieved group. */ group?: Group; } interface GetGroupIdBySlugRequest { /** * Unique part of the group's URL, for example `group-1` in `https:/example.com/groups/group-1`. Pass only the slug. Case-sensitive. * @minLength 1 * @maxLength 100 */ slug?: string; /** @format GUID */ autoInviteId?: string | null; } interface GetGroupIdBySlugResponse { /** * ID of the group that correspond to slug * @format GUID */ groupId?: string; /** Global feed permissions */ accessPermissions?: GlobalFeedPermissions; } interface GlobalFeedPermissions { feedPermissions?: FeedPermissions; ownFeedItemPermissions?: FeedItemPermissions; allFeedItemPermissions?: FeedItemPermissions; activityFeedItemPermissions?: FeedItemPermissions; } interface FeedPermissions { canViewPosts?: boolean; canCreatePosts?: boolean; canPinPosts?: boolean; canCreateTopic?: boolean; canFollowPosts?: boolean; canCreatePaidPosts?: boolean; canReadSettings?: boolean; canManageSettings?: boolean; } interface FeedItemPermissions { canViewFullPost?: boolean; canAssignTopic?: boolean; canUnassignTopic?: boolean; /** bool canFollow = 3; // it's not related to context token */ canUpdate?: boolean; canDelete?: boolean; /** always true */ canShare?: boolean; canAddComment?: boolean; canReact?: boolean; canPin?: boolean; } interface ListGroupsRequest { /** * Number of items to load. Maximum `100`. * @max 100 */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; /** Content type. */ contentType?: ContentTypeWithLiterals; } interface ListGroupsResponse { /** Retrieved Groups. */ groups?: Group[]; /** Paging metadata. */ 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 ListGroupsByUserIdRequest { /** Content type. */ contentType?: ContentTypeWithLiterals; } interface ListGroupsByUserIdResponse { groups?: GroupWithMsId[]; } /** Retrieved Groups by metasite id */ interface GroupWithMsId { metaSiteId?: string; groups?: Group[]; } interface QueryGroupsRequest { /** Query options. */ query?: Query; /** Content type. */ contentType?: ContentTypeWithLiterals; } interface Query { /** * 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?: any; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */ fields?: string[]; /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */ fieldsets?: string[]; } interface Sorting { /** * Name of the field to sort by. * @maxLength 512 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface QueryGroupsResponse { /** Retrieved groups. */ groups?: Group[]; /** Paging metadata. */ metadata?: PagingMetadata; } interface QueryJoinedGroupsRequest { /** Query options. */ query?: Query; /** Content type. */ contentType?: ContentTypeWithLiterals; } interface QueryJoinedGroupsResponse { /** Retrieved groups. */ groups?: Group[]; /** Paging metadata. */ metadata?: PagingMetadata; } interface QueryGroupsByMembershipRequest { /** Query options. */ query?: Query; membershipStatus?: MembershipStatusWithLiterals; /** Filter groups by permissions. */ permissionsFilter?: GroupPermissions; /** Content type. */ contentType?: ContentTypeWithLiterals; } declare enum MembershipStatus { NONE = "NONE", JOINED = "JOINED", PENDING = "PENDING" } /** @enumType */ type MembershipStatusWithLiterals = MembershipStatus | 'NONE' | 'JOINED' | 'PENDING'; interface GroupPermissions { canCreatePosts?: boolean | null; } interface QueryGroupsByMembershipResponse { /** Retrieved groups. */ groups?: Group[]; /** Paging metadata. */ metadata?: PagingMetadata; } interface ListGroupIntegrationsDataRequest { /** * @format GUID * @minSize 1 * @maxSize 100 */ groupIds?: string[]; } interface ListGroupIntegrationsDataResponse { /** * @minSize 1 * @maxSize 100 */ groupsIntegrationsData?: GroupIntegrationsData[]; } interface GroupIntegrationsData { /** @format GUID */ groupId?: string; feedItemsCount?: number; /** @format GUID */ topicIds?: string[]; /** @format GUID */ eventIds?: string[]; /** @format GUID */ connectedPricingPlanIds?: string[]; /** @format GUID */ onlineProgramIds?: string[]; } interface GetGroupMembersGroupIdsRequest { /** * ID of the group to retrieve members group ids. * @format GUID */ groupId?: string; } interface GetGroupMembersGroupIdsResponse { /** * All members group id * @format GUID */ allMembersGroupId?: string; /** * Admins members group id * @format GUID */ adminMembersGroupId?: string; } interface GetGroupBMFeaturesRequest { /** * ID of the group to retrieve BM features. * @format GUID */ groupId?: string; } interface GetGroupBMFeaturesResponse { level?: number; features?: BMFeatures; } interface BMFeatures { /** @maxSize 10 */ bmFeatures?: BMFeatureWithLiterals[]; } declare enum BMFeature { BM_FEATURES_UNKNOWN = "BM_FEATURES_UNKNOWN", BM_FEATURES_GENERATE_TOPICS = "BM_FEATURES_GENERATE_TOPICS", BM_FEATURES_GENERATE_QUESTIONS = "BM_FEATURES_GENERATE_QUESTIONS" } /** @enumType */ type BMFeatureWithLiterals = BMFeature | 'BM_FEATURES_UNKNOWN' | 'BM_FEATURES_GENERATE_TOPICS' | 'BM_FEATURES_GENERATE_QUESTIONS'; interface QueryJoinedGroupsWithMemberRequest { /** Query options. */ query?: Query; /** * ID of the member to find common groups with * @format GUID */ memberId?: string; /** Content type. */ contentType?: ContentTypeWithLiterals; } interface QueryJoinedGroupsWithMemberResponse { /** Retrieved groups. */ groups?: Group[]; /** Paging metadata. */ metadata?: PagingMetadata; } interface GetPrivacyRequest { /** * Group ids to list privacy for * @format GUID * @maxSize 100 */ groupIds?: string[]; } interface GetPrivacyResponse { /** Privacy statuses listed per group id */ privacyStatuses?: Record; } 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 GroupCreatedEnvelope { entity: Group; metadata: EventMetadata; } /** * Triggered when a group is created. * @webhook * @eventType wix.social_groups.v2.group_created * @serviceIdentifier wix.social.groups.api.v2.GroupsService * @slug created */ declare function onGroupCreated(handler: (event: GroupCreatedEnvelope) => void | Promise): void; interface GroupDeletedEnvelope { metadata: EventMetadata; } /** * Triggered when a group is deleted. * @webhook * @eventType wix.social_groups.v2.group_deleted * @serviceIdentifier wix.social.groups.api.v2.GroupsService * @slug deleted */ declare function onGroupDeleted(handler: (event: GroupDeletedEnvelope) => void | Promise): void; interface GroupCoverChangedEnvelope { data: GroupCoverChanged; metadata: EventMetadata; } /** * Triggered when a group's logo is changed. * @webhook * @eventType wix.social_groups.v2.group_group_cover_changed * @serviceIdentifier wix.social.groups.api.v2.GroupsService * @slug group_cover_changed */ declare function onGroupCoverChanged(handler: (event: GroupCoverChangedEnvelope) => void | Promise): void; interface GroupDescriptionChangedEnvelope { data: GroupDescriptionChanged; metadata: EventMetadata; } /** * Triggered when a group's description is changed. * @webhook * @eventType wix.social_groups.v2.group_group_description_changed * @serviceIdentifier wix.social.groups.api.v2.GroupsService * @slug group_description_changed */ declare function onGroupDescriptionChanged(handler: (event: GroupDescriptionChangedEnvelope) => void | Promise): void; interface GroupUpdatedEnvelope { entity: Group; metadata: EventMetadata; } /** * Triggered when a group is updated. See payload for more information about the specific trigger. * @webhook * @eventType wix.social_groups.v2.group_updated * @serviceIdentifier wix.social.groups.api.v2.GroupsService * @slug updated */ declare function onGroupUpdated(handler: (event: GroupUpdatedEnvelope) => void | Promise): void; /** * Creates a group. * * When a group is created, the newly created group is added to the [Groups List](https://support.wix.com/en/article/wix-groups-about-your-groups-pages#groups-group-list) page * of a site. * * Specify a `creatorId` to set the group's creator. The group's creator will automatically become a group admin. See [Terminology](https://dev.wix.com/docs/rest/crm/community/groups/terminology) for more information on roles. * * * Wix users determine who can create a group. * This setting can be found in [a site's Dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fwix-groups/settings?) underĀ **Groups > General Settings > Group Creation**. * If set to **members with approval**, site members can create a group with the Create GroupĀ method, and the group becomes a `createRequest` with a status of `PENDING`. * A Wix user either approves or rejects the request to create a group. * If set to **all site members**, site members can create a group with the Create Group method and no approval is required. * If set to **only admins**, only Wix users can create a group with the Create Group method. * Default is set to **members with approval**. * @param group - Group to create. * @public * @requiredField group * @param options - Optional fields for group creation. * @returns Created group. * @fqn wix.social.groups.api.v2.GroupsService.CreateGroup */ declare function createGroup(group: Group, options?: CreateGroupOptions): Promise>; interface CreateGroupOptions { /** * ID of the member who created the group, from the Members API. This member will automatically become an admin. * @format GUID */ creatorId?: string | null; /** Content type. */ contentType?: ContentTypeWithLiterals; } /** * Updates a group. * * When a public or private group's name is updated, the slug is updated to reflect the new group name. * Only group admins can update their group. * * > **Notes:** * > + When `group.privacyStatus` is updated from `PRIVATE` to `PUBLIC`, all pending group join requests are automatically approved. * > + When `group.privacyStatus` is updated from `PRIVATE` to `SECRET`, all pending group join requests are automatically rejected. * @param _id - Group ID. * @public * @requiredField _id * @requiredField group * @returns Updated group. * @fqn wix.social.groups.api.v2.GroupsService.UpdateGroup */ declare function updateGroup(_id: string, group: UpdateGroup, options?: UpdateGroupOptions): Promise>; interface UpdateGroup { /** * Group ID. * @readonly * @format GUID */ _id?: string | null; /** * A unique part of a group's URL, for example `https:/example.com/groups/slug`. * @minLength 1 * @maxLength 100 */ slug?: string | null; /** Group privacy status. */ privacyStatus?: PrivacyStatusWithLiterals; /** * Group name. * @maxLength 100 */ name?: string | null; /** * Group description in [DraftJS](https://draftjs.org) format. * @maxLength 20480 */ description?: string | null; /** * Group teaser. * @maxLength 1000 */ teaser?: string | null; /** * What group members are called, for example `Coworkers`, `Friends`, or `Students`. * @minLength 1 * @maxLength 1000 */ memberTitle?: string | null; /** Cover image. You cannot upload your own cover image. */ coverImage?: CoverImage; /** * Group specific settings. * * These settings can also be found in [a site's Dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fwix-groups/settings?). */ settings?: GroupSettings; /** * Total count of current group members. * @readonly */ membersCount?: number | null; /** * Group owner. * @readonly * @format GUID */ ownerId?: string | null; /** * Group creation date and time. * @readonly */ _createdDate?: Date | null; /** * Date and time of the latest group update. * @readonly */ _updatedDate?: Date | null; /** * Date and time of the most recent group activity, for example a post or comment. * @readonly */ lastActivityDate?: Date | null; } interface UpdateGroupOptions { /** Content type. */ contentType?: ContentTypeWithLiterals; } /** @param groupId - ID of the group to delete. * @public * @requiredField groupId * @fqn wix.social.groups.api.v2.GroupsService.DeleteGroup */ declare function deleteGroup(groupId: string): Promise>; /** * Retrieves a group. * * For groups with `group.privacyStatus` set to `SECRET`, only group admins and group members can see the group and its content. * @param groupId - ID of the group to retrieve. * @public * @requiredField groupId * @returns Retrieved group. * @fqn wix.social.groups.api.v2.GroupsService.GetGroup */ declare function getGroup(groupId: string, options?: GetGroupOptions): Promise>; interface GetGroupOptions { /** Content type. */ contentType?: ContentTypeWithLiterals; } /** * Retrieves a group by slug. * * The slug is the end of a group's URL that refers to a specific group. * For example, if a group's URL is `https:/example.com/groups/{my-fitness-group}`, the slug is `my-fitness-group`. * Slugs are case-sensitive. It is generally based on the group name, but for secret groups it is an autogenerated string of characters, * for example, `https:/example.com/groups/{5D3yTX}`. * * For groups with `group.privacyStatus` set to `SECRET`, only group admins and group members can see the group and its content. * @param slug - Unique part of the group's URL. For example, if a group's URL is `https:/example.com/groups/{my-fitness-group}`, the slug is `my-fitness-group`. Case-sensitive. * @public * @requiredField slug * @fqn wix.social.groups.api.v2.GroupsService.GetGroupBySlug */ declare function getGroupBySlug(slug: string, options?: GetGroupBySlugOptions): Promise>; interface GetGroupBySlugOptions { /** @format GUID */ autoInviteId?: string | null; /** Content type. */ contentType?: ContentTypeWithLiterals; } /** * Retrieves up to 100 groups. * * * Default sorts by `_createdDate` in descending order. For `SECRET` groups, only group admins and group members can see a list of groups and their content. * * > **Note:** This function's parameters are positional, and must be specified in the sequence shown in the syntax below. When specifying a parameter, use `null` as a placeholder for any unspecified parameters. For example, to specify limit only, call `listGroups(paging, null)`. * @public * @param options - Limit and offset options. * @fqn wix.social.groups.api.v2.GroupsService.ListGroups */ declare function listGroups(options?: ListGroupsOptions): Promise>; interface ListGroupsOptions { /** * Number of items to load. Maximum `100`. * @max 100 */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; /** Content type. */ contentType?: ContentTypeWithLiterals; } /** * Retrieves up to 100 groups, given the provided paging, filtering, and sorting. * * Supported fields for filtering: * - `title` * * Supported fields for sorting: * - `title` * - `createdDate` * - `membersCount` * - `recentActivityDate` * * For groups with `group.privacyStatus` set to `SECRET`, only group admins and group members can see the group and its content. * @public * @fqn wix.social.groups.api.v2.GroupsService.QueryGroups */ declare function queryGroups(options?: QueryGroupsOptions): GroupsQueryBuilder; interface QueryGroupsOptions { /** Content type. */ contentType?: ContentTypeWithLiterals | undefined; } interface QueryOffsetResult { currentPage: number | undefined; totalPages: number | undefined; totalCount: number | undefined; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface GroupsQueryResult extends QueryOffsetResult { items: Group[]; query: GroupsQueryBuilder; next: () => Promise; prev: () => Promise; } interface GroupsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: string, value: any) => GroupsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: string, value: any) => GroupsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ge: (propertyName: string, value: any) => GroupsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ gt: (propertyName: string, value: any) => GroupsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ le: (propertyName: string, value: any) => GroupsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ lt: (propertyName: string, value: any) => GroupsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. */ startsWith: (propertyName: string, value: string) => GroupsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasSome: (propertyName: string, value: any[]) => GroupsQueryBuilder; in: (propertyName: string, value: any) => GroupsQueryBuilder; exists: (propertyName: string, value: boolean) => GroupsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ ascending: (...propertyNames: Array<'membersCount' | '_createdDate'>) => GroupsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ descending: (...propertyNames: Array<'membersCount' | '_createdDate'>) => GroupsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => GroupsQueryBuilder; /** @param skip - Number of items to skip in the query results before returning the results. */ skip: (skip: number) => GroupsQueryBuilder; find: () => Promise; } /** * @hidden * @fqn wix.social.groups.api.v2.GroupsService.QueryGroups * @requiredField query */ declare function typedQueryGroups(query: GroupQuery, options?: QueryGroupsOptions): Promise>; interface GroupQuerySpec extends QuerySpec { paging: 'offset'; wql: []; } type CommonQueryWithEntityContext = Query$1; type GroupQuery = { /** 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']; /** Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: { /** Name of the field to sort by. @maxLength: 512 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; }[]; /** Paging options to limit and skip the number of items. */ paging?: { /** Number of items to load. */ limit?: NonNullable['limit'] | null; /** Number of items to skip in the current sort order. */ offset?: NonNullable['offset'] | null; }; }; declare const utils: { QueryBuilder: () => _wix_sdk_types.QueryBuilder; Filter: _wix_sdk_types.FilterFactory; Sort: _wix_sdk_types.SortFactory; }; export { type AccessRestriction, type AccessRestrictionDataOneOf, type AccountInfo, type AccountInfoMetadata, type ActionEvent, AllowPolicy, type AllowPolicyWithLiterals, BMFeature, type BMFeatureWithLiterals, type BMFeatures, type BaseEventMetadata, type CommonQueryWithEntityContext, ContentType, type ContentTypeWithLiterals, type CoverImage, type CreateGroupOptions, type CreateGroupRequest, type CreateGroupResponse, type DeleteGroupRequest, type DeleteGroupResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Events, type FeedItemPermissions, type FeedPermissions, type GetGroupBMFeaturesRequest, type GetGroupBMFeaturesResponse, type GetGroupBySlugOptions, type GetGroupBySlugRequest, type GetGroupBySlugResponse, type GetGroupIdBySlugRequest, type GetGroupIdBySlugResponse, type GetGroupMembersGroupIdsRequest, type GetGroupMembersGroupIdsResponse, type GetGroupOptions, type GetGroupRequest, type GetGroupResponse, type GetPrivacyRequest, type GetPrivacyResponse, type GlobalFeedPermissions, type Group, type GroupCoverChanged, type GroupCoverChangedEnvelope, type GroupCreatedEnvelope, type GroupDeletedEnvelope, type GroupDescriptionChanged, type GroupDescriptionChangedEnvelope, type GroupDetails, type GroupDetailsPosition, type GroupIntegrationsData, type GroupPermissions, type GroupQuery, type GroupQuerySpec, type GroupSettings, type GroupUpdatedEnvelope, type GroupWithMsId, type GroupsQueryBuilder, type GroupsQueryResult, type IdentificationData, type IdentificationDataIdOneOf, type Identity, IdentityType, type IdentityTypeWithLiterals, type Image, type ListGroupIntegrationsDataRequest, type ListGroupIntegrationsDataResponse, type ListGroupsByUserIdRequest, type ListGroupsByUserIdResponse, type ListGroupsOptions, type ListGroupsRequest, type ListGroupsResponse, type Logo, MembershipStatus, type MembershipStatusWithLiterals, type MessageEnvelope, type OnboardingStepSettings, type Paging, type PagingMetadata, type Position, PrivacyStatus, type PrivacyStatusWithLiterals, type Query, type QueryGroupsByMembershipRequest, type QueryGroupsByMembershipResponse, type QueryGroupsOptions, type QueryGroupsRequest, type QueryGroupsResponse, type QueryJoinedGroupsRequest, type QueryJoinedGroupsResponse, type QueryJoinedGroupsWithMemberRequest, type QueryJoinedGroupsWithMemberResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, StepKey, type StepKeyWithLiterals, Type, type TypeWithLiterals, type UpdateGroup, type UpdateGroupOptions, type UpdateGroupRequest, type UpdateGroupResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createGroup, deleteGroup, getGroup, getGroupBySlug, listGroups, onGroupCoverChanged, onGroupCreated, onGroupDeleted, onGroupDescriptionChanged, onGroupUpdated, queryGroups, typedQueryGroups, updateGroup, utils };