/** * The wix-groups-backend module contains functionality for managing groups on your site from backend code. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.html#) */ declare module 'wix-groups-backend' { /** * The CreateRequests API provides functionality for managing requests to create a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.html#createRequests) */ const createRequests: CreateRequests; /** * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.html#groups) */ const groups: Groups; /** * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.html#joinRequests) */ const joinRequests: JoinRequests; /** * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.html#members) */ const members: Members; /** * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.html#roles) */ const roles: Roles; /** * Group cover image. */ type CoverImage = { /** * **Deprecated**. Use the `imageUrl` property instead. * * Group cover image. Only site admins or group admins can upload a group cover image. */ image?: Image; /** * Position of the group cover image relative to the uploaded image. */ position?: Position; /** * The group cover image's Wix media URL in the following format: `'wix:image://v1//#originWidth=&originHeight=[&watermark=]'`. Note that the URL contains the image's width and height. * * **Note:** This replaces the old `image` property. `image` will continue to work, but we recommend that you use the updated `imageUrl` property instead. */ imageUrl?: string; }; /** * Group cover image. */ type CoverImageOptions = { /** * **Deprecated**. Use the `imageUrl` property instead. * * Group cover image. Only site admins or group admins can upload a group cover image. */ image?: ImageOptions; /** * Position of the top left corner of the group cover image relative to the uploaded image. */ position?: PositionOptions; /** * The group cover image's Wix media URL in the following format: `'wix:image://v1//#originWidth=&originHeight=[&watermark=]'`. Note that the URL contains the image's width and height. * * **Note:** This replaces the old `image` property. `image` will continue to work, but we recommend that you use the updated `imageUrl` property instead. */ imageUrl?: string; }; type Group = { /** * Group ID. */ _id: string; /** * Group name. */ name: string; /** * Part of a group's URL, for example, `'https:/example.com/groups/{my-group-slug}'`. Generally based on the group name, but for secret groups it is * an autogenerated string of characters, for example, `'https:/example.com/groups/{5D3yTX}'`. It is case-sensitive. */ slug: string; /** * Group description. */ description: string; /** * Group privacy level. * One of: * + `PUBLIC`: Site visitors can see the group and its content in the list of groups. Site members can join the group. * + `PRIVATE`: Site visitors can see the group in the list of groups, but only group members can see its content. Site members can request to join the group. * + `SECRET`: Only group members can see the group and its content in the list of groups. Site members can only join if invited by group admins, or other group members. */ privacyStatus: string; /** * Group cover image. */ coverImage?: CoverImage; /** * What group members are called. For example, 'Coworkers', 'Friends', or 'Students'. */ memberTitle?: string; /** * Number of members in the group. */ memberCount: number; /** * Group settings. */ settings: GroupSettings; /** * Date and time the group was last active. For example, a post or comment. */ lastActivityDate: Date; /** * Date and time the group was created. */ _createdDate: Date; /** * Date and time the group was last updated. */ _updatedDate: Date; /** * Site member ID of the group creator. Defaults to group creator. */ owner: string; }; /** * Group settings. */ type GroupSettings = { /** * Whether group members can send an email inviting others to join the group. When `false`, only site admins and group admins can invite others to join the group. Defaults to `false`. */ membersCanInvite: boolean; /** * Whether group members can approve or reject requests to join a group. When `false`, only site admins and group admins can approve or reject requests to join the group. Defaults to `false`. */ membersCanApprove: boolean; /** * Whether to create a daily group post welcoming new members. Defaults to `true`. */ welcomeMemberPostEnabled: boolean; /** * Whether to create a group post when group details are changed. Defaults to `true`. */ groupUpdatePostEnabled: boolean; /** * Whether group members can view the list of members in the group. Defaults to `true`. */ showMemberList: boolean; }; /** * Group settings. */ type GroupSettingsOptions = { /** * Whether group members can send an email inviting others to join the group. When `false`, only site admins and group admins can invite others to join the group. Defaults to `false`. */ membersCanInvite?: boolean; /** * Whether group members can approve or reject requests to join a group. When `false`, only site admins and group admins can approve or reject requests to join the group. Defaults to `false`. */ membersCanApprove?: boolean; /** * Whether to create a daily group post welcoming new members. Defaults to `true`. */ welcomeMemberPostEnabled?: boolean; /** * Whether to create a group post when group details are changed. Defaults to `true`. */ groupUpdatePostEnabled?: boolean; /** * Whether group members can view the list of members in the group. Defaults to `true`. */ showMemberList?: boolean; }; /** * Group cover image. Only site admins or group admins can upload a group cover image. */ type Image = { /** * **Deprecated**. * * Group cover image's file URL. */ mediaId?: string; /** * **Deprecated**. * * Group cover image width. */ width?: number; /** * **Deprecated**. * * Group cover image height. */ height?: number; }; /** * Group cover image. Only site admins or group admins can upload a group cover image. */ type ImageOptions = { /** * **Deprecated**. * * Group cover image's file URL. */ mediaId?: string; /** * **Deprecated**. * * Group cover image width. */ width?: number; /** * **Deprecated**. * * Group cover image height. */ height?: number; }; type Metadata = { /** * Number of items in the current results page. */ length?: number; /** * Total number of items that match the query. */ totalCount?: number; /** * Flag indicating that the server failed to calculate the 'total' field. */ tooManyToCount?: boolean; }; type Options = { /** * When `true`, prevents permission checks from running for the operation. Defaults to `false`. */ suppressAuth?: boolean; }; /** * Position of the top left corner of the group cover image relative to the uploaded image. */ type Position = { /** * Horizontal coordinate. */ x?: number; /** * Vertical coordinate. */ y?: number; }; /** * Position of the top left corner of the group cover image relative to the uploaded image. */ type PositionOptions = { /** * Horizontal coordinate. */ x?: number; /** * Vertical coordinate. */ y?: number; }; /** * Group member role. When membership status is not `JOINED`, this is empty. */ type Role = { /** * Group member role. * One of: * - `"MEMBER"`: Group member. * - `"ADMIN"`: Group admin. */ role: string; }; /** * The CreateRequests API provides functionality for managing requests to create a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.html#) */ interface CreateRequests { /** * Approves requests to create a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.html#approveCreateRequests) */ approveCreateRequests(createRequestIds: string[], options?: Options): Promise; /** * Lists requests to create a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.html#listCreateRequests) */ listCreateRequests(paging?: CreateRequests.Paging, options?: Options): Promise; /** * Creates a query to retrieve a list of create requests. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.html#queryCreateRequests) */ queryCreateRequests(): CreateRequests.CreateRequestsQueryBuilder; /** * Rejects requests to create a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.html#rejectCreateRequests) */ rejectCreateRequests(rejections: CreateRequests.RejectCreateRequest[], options?: Options): Promise; } /** * The Groups API provides functionality for managing groups, including creating, deleting, updating, and querying groups. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#) */ interface Groups { /** * Creates a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#createGroup) */ createGroup(groupInfo: Groups.GroupInfo, options?: Options): Promise; /** * Deletes a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#deleteGroup) */ deleteGroup(groupId: string, options?: Options): Promise; /** * Gets a group by ID. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#getGroup) */ getGroup(groupId: string, options?: Options): Promise; /** * Gets a group by slug. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#getGroupBySlug) */ getGroupBySlug(slug: string, options?: Options): Promise; /** * Lists groups. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#listGroups) */ listGroups(paging?: Groups.Paging, options?: Options): Promise; /** * Creates a query to retrieve a list of groups. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#queryGroups) */ queryGroups(): Groups.GroupsQueryBuilder; /** * Updates a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#updateGroup) */ updateGroup(groupId: string, groupInfo: Groups.GroupInfoUpdate, options?: Options): Promise; } /** * The JoinRequests API provides functionality for managing requests to join a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.html#) */ interface JoinRequests { /** * Approves requests to join a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.html#approveJoinRequests) */ approveJoinRequests(identifiers: JoinRequests.Identifiers, options?: Options): Promise; /** * Lists requests to join a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.html#listJoinRequests) */ listJoinRequests(groupId: string, paging?: JoinRequests.Paging, options?: Options): Promise; /** * Creates a query to retrieve a list of join requests. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.html#queryJoinRequests) */ queryJoinRequests(): JoinRequests.JoinRequestsQueryBuilder; /** * Rejects requests to join a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.html#rejectJoinRequests) */ rejectJoinRequests(groupId: string, rejections: JoinRequests.Rejection[], options?: Options): Promise; } /** * The Members API provides functionality for managing group members, inluding adding, removing, and querying group members. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.html#) */ interface Members { /** * Adds site members to a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.html#addGroupMembers) */ addGroupMembers(identifiers: Members.IdentifiersAddGroupMembers, options?: Options): Promise; /** * Lists all members of a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.html#listGroupMembers) */ listGroupMembers(groupId: string, paging?: Members.Paging, options?: Options): Promise; /** * Lists all group memberships of a site member. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.html#listMemberships) */ listMemberships(memberId: string, paging?: Members.PagingMemberships, options?: Options): Promise; /** * Retrieves a list of up to 100 group members, given the provided paging, sorting and filtering. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.html#queryGroupMembers) */ queryGroupMembers(): Members.GroupMembersQueryBuilder; /** * Retrieves a list of up to 100 memberships, given the provided paging, sorting and filtering. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.html#queryMemberships) */ queryMemberships(): Members.GroupMembersQueryBuilder; /** * Removes members from a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.html#removeGroupMembers) */ removeGroupMembers(identifiers: Members.IdentifiersRemoveGroupMembers, options?: Options): Promise; } /** * The Roles API provides functionality for assigning and unassigning a role to a group member. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Roles.html#) */ interface Roles { /** * Assigns a role to group members. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Roles.html#assignRole) */ assignRole(identifiers: Roles.Identifiers, role: string, options?: Options): Promise; /** * Unassigns a role from group members. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Roles.html#unassignRole) */ unassignRole(identifiers: Roles.Identifiers, role: string, options?: Options): Promise; } /** * The CreateRequests API provides functionality for managing requests to create a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.html#) */ namespace CreateRequests { type CreateRequest = { /** * ID of the request to create a group. Same as group ID. */ _id: string; /** * Status of the request to create a group. * One of: * + `"PENDING"` * + `"APPROVED"` * + `"REJECTED"` */ status: string; /** * Reason the request to create a group was rejected. */ rejectionReason?: string; /** * Group requested to create. */ group: Group; }; type ListCreateRequests = { /** * Requests to create a group. */ createRequests: CreateRequests.CreateRequest[]; /** * Paging information. */ metadata: Metadata; }; type Paging = { /** * Maximum number of create requests to retrieve. Defaults to 1,000. */ limit?: number; /** * Number of create requests to skip in the list. */ skip?: number; }; type RejectCreateRequest = { /** * ID of the create request to reject. */ createRequestId: string; /** * Reason the request to create a group was rejected. Max 1,000 characters. This text is displayed to the creator of the rejected request. */ reason?: string; }; /** * Contains functionality for refining a CreateRequests query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#) */ interface CreateRequestsQueryBuilder { /** * Adds a sort to a query, sorting by the specified properties in ascending order. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#ascending) */ ascending(...propertyName: string[]): CreateRequests.CreateRequestsQueryBuilder; /** * Adds a sort to a query, sorting by the specified properties in descending order. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#descending) */ descending(...propertyName: string[]): CreateRequests.CreateRequestsQueryBuilder; /** * Refines a query to match items whose specified property value equals the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#eq) */ eq(propertyName: string, value: any): CreateRequests.CreateRequestsQueryBuilder; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#find) */ find(options?: Options): Promise; /** * Refines a query to match items whose specified property value contains any of the specified values. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#hasSome) */ hasSome(propertyName: string, values: string[]): CreateRequests.CreateRequestsQueryBuilder; /** * Limits the number of items the query returns. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#limit) */ limit(limit: string): CreateRequests.CreateRequestsQueryBuilder; /** * Refines a query to match items whose specified property value does not equal the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#ne) */ ne(propertyName: string, value: any): CreateRequests.CreateRequestsQueryBuilder; /** * Adds an `or` condition to the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#or) */ or(query: CreateRequests.CreateRequestsQueryBuilder): CreateRequests.CreateRequestsQueryBuilder; /** * Sets the number of items to skip before returning query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#skip) */ skip(skip: string): CreateRequests.CreateRequestsQueryBuilder; } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#) */ interface CreateRequestsQueryResult { /** * Returns the index of the current results page number. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#currentPage) */ readonly currentPage: number; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#items) */ readonly items: CreateRequests.CreateRequest[]; /** * Returns the number of items in the current results page. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#length) */ readonly length: number; /** * Returns the query page size. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#pageSize) */ readonly pageSize: number; /** * Returns the `CreateRequestsQueryBuilder` object used to get the current results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#query) */ readonly query: CreateRequests.CreateRequestsQueryBuilder; /** * Returns the total number of items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#totalCount) */ readonly totalCount: number; /** * Returns the total number of pages the query produced. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#totalPages) */ readonly totalPages: number; /** * Retrieves the next page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#next) */ next(): Promise; /** * Retrieves the previous page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#prev) */ prev(): Promise; } /** * Contains functionality for refining a CreateRequests query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryBuilder.html#) */ namespace CreateRequestsQueryBuilder { } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.CreateRequests.CreateRequestsQueryResult.html#) */ namespace CreateRequestsQueryResult { } } /** * The Groups API provides functionality for managing groups, including creating, deleting, updating, and querying groups. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.html#) */ namespace Groups { type GroupInfo = { /** * Group name. */ name: string; /** * Group description. */ description?: string; /** * Group privacy level. * One of: * + `PUBLIC`: Site visitors can see the group and its content in the list of groups. Site members can join the group. * + `PRIVATE`: Site visitors can see the group in the list of groups, but only group members can see its content. Site members can request to join the group. * + `SECRET`: Only group members can see the group and its content in the list of groups. Site members can only join if invited by group admins, or other group members. */ privacyStatus?: string; /** * Group cover image. */ coverImage?: CoverImage; /** * What group members are called. For example, 'Coworkers', 'Friends', or 'Students'. */ memberTitle?: string; /** * Group settings. */ settings?: GroupSettings; /** * Site member ID of the group creator. Defaults to group creator. Required if using suppressAuth. */ owner?: string; }; /** * Group to update. */ type GroupInfoUpdate = { /** * Group name. */ name?: string; /** * Group description. */ description?: string; /** * Group privacy level. * One of: * + `PUBLIC`: Site visitors can see the group and its content in the list of groups. Site members can join the group. * + `PRIVATE`: Site visitors can see the group in the list of groups, but only group members can see its content. Site members can request to join the group. * + `SECRET`: Only group members can see the group and its content in the list of groups. Site members can only join if invited by group admins, or other group members. */ privacyStatus?: string; /** * Group cover image. */ coverImage?: CoverImageOptions; /** * What group members are called. For example, 'Coworkers', 'Friends', or 'Students'. */ memberTitle?: string; /** * Group settings. */ settings?: GroupSettingsOptions; /** * Site member ID of the group creator. */ owner?: string; }; type ListGroups = { /** * List of groups. */ groups: Group[]; /** * Paging information. */ metadata: Metadata; }; type Paging = { /** * Maximum number of groups to retrieve. Defaults to 1,000. */ limit?: number; /** * Number of groups to skip in the list. */ skip?: number; }; /** * Contains functionality for refining a Groups query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#) */ interface GroupsQueryBuilder { /** * Adds a sort to a query, sorting by the specified properties in ascending order. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#ascending) */ ascending(...propertyName: string[]): Groups.GroupsQueryBuilder; /** * Refines a query to match items whose specified property value contains a specified string. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#contains) */ contains(propertyName: string, value: string): Groups.GroupsQueryBuilder; /** * Adds a sort to a query, sorting by the specified properties in descending order. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#descending) */ descending(...propertyName: string[]): Groups.GroupsQueryBuilder; /** * Refines a query to match items whose specified property value ends with a specified string. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#endsWith) */ endsWith(propertyName: string, value: string): Groups.GroupsQueryBuilder; /** * Refines a query to match items whose specified property value equals the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#eq) */ eq(propertyName: string, value: any): Groups.GroupsQueryBuilder; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#find) */ find(options?: Options): Promise; /** * Refines a query to match items whose specified property value contains any of the specified values. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#hasSome) */ hasSome(propertyName: string, values: string[]): Groups.GroupsQueryBuilder; /** * Limits the number of items the query returns. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#limit) */ limit(limit: string): Groups.GroupsQueryBuilder; /** * Refines a query to match items whose specified property value does not equal the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#ne) */ ne(propertyName: string, value: any): Groups.GroupsQueryBuilder; /** * Adds an `or` condition to the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#or) */ or(query: Groups.GroupsQueryBuilder): Groups.GroupsQueryBuilder; /** * Sets the number of items to skip before returning query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#skip) */ skip(skip: string): Groups.GroupsQueryBuilder; /** * Refines a query to match items whose specified property value starts with a specified string. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#startsWith) */ startsWith(propertyName: string, value: string): Groups.GroupsQueryBuilder; } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#) */ interface GroupsQueryResult { /** * Returns the index of the current results page number. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#currentPage) */ readonly currentPage: number; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#items) */ readonly items: Group[]; /** * Returns the number of items in the current results page. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#length) */ readonly length: number; /** * Returns the query page size. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#pageSize) */ readonly pageSize: number; /** * Returns the `GroupsQueryBuilder` object used to get the current results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#query) */ readonly query: Groups.GroupsQueryBuilder; /** * Returns the total number of items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#totalCount) */ readonly totalCount: number; /** * Returns the total number of pages the query produced. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#totalPages) */ readonly totalPages: number; /** * Retrieves the next page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#next) */ next(): Promise; /** * Retrieves the previous page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#prev) */ prev(): Promise; } /** * Contains functionality for refining a Groups query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryBuilder.html#) */ namespace GroupsQueryBuilder { } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Groups.GroupsQueryResult.html#) */ namespace GroupsQueryResult { } } /** * The JoinRequests API provides functionality for managing requests to join a group. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.html#) */ namespace JoinRequests { type Identifiers = { /** * ID of the group requested to join. */ groupId: string; /** * IDs of the site members to approve. */ memberIds: string[]; }; type JoinRequest = { /** * Site member ID of the requester. */ memberId: string; /** * Date the site member requested to join the group. */ _createdDate: Date; /** * Status of the request to join a group. * One of: * - `"PENDING"` * - `"APPROVED"` * - `"REJECTED"` */ status: string; /** * Reason the request to join a group was rejected. */ rejectionReason?: string; }; type ListJoinRequests = { /** * Requests to join a group. */ joinRequests: JoinRequests.JoinRequest[]; /** * Paging information. */ metadata: Metadata; }; type Paging = { /** * Maximum number of join requests to retrieve. Defaults to 100. */ limit?: number; /** * Number of join requests to skip in the list. */ skip?: number; }; type Rejection = { /** * ID of the site member to reject. */ memberId: string; /** * Reason the request to join a group was rejected. Text written by the request reviewer that is displayed when the group is rejected (max 1,000 characters). */ reason: string; }; /** * Contains functionality for refining a JoinRequests query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#) */ interface JoinRequestsQueryBuilder { /** * Refines a query to match items whose specified property value equals the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#eq) */ eq(propertyName: string, value: any): JoinRequests.JoinRequestsQueryBuilder; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#find) */ find(options?: Options): Promise; /** * Refines a query to match items whose specified property value contains any of the specified values. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#hasSome) */ hasSome(propertyName: string, values: string[]): JoinRequests.JoinRequestsQueryBuilder; /** * Limits the number of items the query returns. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#limit) */ limit(limit: string): JoinRequests.JoinRequestsQueryBuilder; /** * Refines a query to match items whose specified property value does not equal the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#ne) */ ne(propertyName: string, value: any): JoinRequests.JoinRequestsQueryBuilder; /** * Adds an `or` condition to the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#or) */ or(query: JoinRequests.JoinRequestsQueryBuilder): JoinRequests.JoinRequestsQueryBuilder; /** * Sets the number of items to skip before returning query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#skip) */ skip(skip: string): JoinRequests.JoinRequestsQueryBuilder; } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#) */ interface JoinRequestsQueryResult { /** * Returns the index of the current results page number. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#currentPage) */ readonly currentPage: number; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#items) */ readonly items: JoinRequests.JoinRequest[]; /** * Returns the number of items in the current results page. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#length) */ readonly length: number; /** * Returns the query page size. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#pageSize) */ readonly pageSize: number; /** * Returns the `JoinRequestsQueryBuilder` object used to get the current results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#query) */ readonly query: JoinRequests.JoinRequestsQueryBuilder; /** * Returns the total number of items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#totalCount) */ readonly totalCount: number; /** * Returns the total number of pages the query produced. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#totalPages) */ readonly totalPages: number; /** * Retrieves the next page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#next) */ next(): Promise; /** * Retrieves the previous page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#prev) */ prev(): Promise; } /** * Contains functionality for refining a JoinRequests query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryBuilder.html#) */ namespace JoinRequestsQueryBuilder { } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.JoinRequests.JoinRequestsQueryResult.html#) */ namespace JoinRequestsQueryResult { } } /** * The Members API provides functionality for managing group members, inluding adding, removing, and querying group members. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.html#) */ namespace Members { type GroupMember = { /** * Group member role. * One of: * - `"MEMBER"`: Group member. * - `"ADMIN"`: Group admins. */ role: string; /** * Site member ID of group member. */ memberId: string; /** * Date and time the group member joined the group. */ joinedDate: Date; }; type IdentifiersAddGroupMembers = { /** * ID of the group. */ groupId: string; /** * IDs of the site members to add to the group. */ memberIds: string[]; }; type IdentifiersRemoveGroupMembers = { /** * ID of the group. */ groupId: string; /** * IDs of the site members to remove from the group. */ memberIds: string[]; }; type ListGroupMembers = { /** * Group members. */ members: Members.GroupMember[]; /** * Paging information. */ metadata: Metadata; }; type ListMemberships = { /** * Site member's memberships. */ memberships: Members.Membership[]; /** * Paging information. */ metadata: Metadata; }; type Membership = { /** * Group ID. */ groupId: string; /** * Group membership status. * One of: * - `"JOINED"` * - `"PENDING"` */ status: string; /** * Group member role. * One of: * - `"MEMBER"`: Group member. * - `"ADMIN"`: Group admins. */ role: string; }; type Paging = { /** * Maximum number of group members to retrieve. Defaults to 100. */ limit?: number; /** * Number of group members to skip in the list. */ skip?: number; }; type PagingMemberships = { /** * Maximum number of memberships to retrieve. Defaults to 100. */ limit?: number; /** * Number of memberships to skip in the list. */ skip?: number; }; /** * Contains functionality for refining a Members query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#) */ interface GroupMembersQueryBuilder { /** * Adds a sort to a query, sorting by the specified properties in ascending order. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#ascending) */ ascending(...propertyName: string[]): Members.GroupMembersQueryBuilder; /** * Adds a sort to a query, sorting by the specified properties in descending order. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#descending) */ descending(...propertyName: string[]): Members.GroupMembersQueryBuilder; /** * Refines a query to match items whose specified property value equals the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#eq) */ eq(propertyName: string, value: any): Members.GroupMembersQueryBuilder; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#find) */ find(options?: Options): Promise; /** * Limits the number of items the query returns. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#limit) */ limit(limit: string): Members.GroupMembersQueryBuilder; /** * Refines a query to match items whose specified property value does not equal the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#ne) */ ne(propertyName: string, value: any): Members.GroupMembersQueryBuilder; /** * Sets the number of items to skip before returning query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#skip) */ skip(skip: string): Members.GroupMembersQueryBuilder; } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#) */ interface GroupMembersQueryResult { /** * Returns the index of the current results page number. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#currentPage) */ readonly currentPage: number; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#items) */ readonly items: Members.GroupMember[]; /** * Returns the number of items in the current results page. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#length) */ readonly length: number; /** * Returns the query page size. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#pageSize) */ readonly pageSize: number; /** * Returns the `GroupMembersQueryBuilder` object used to get the current results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#query) */ readonly query: Members.GroupMembersQueryBuilder; /** * Returns the total number of items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#totalCount) */ readonly totalCount: number; /** * Returns the total number of pages the query produced. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#totalPages) */ readonly totalPages: number; /** * Retrieves the next page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#next) */ next(): Promise; /** * Retrieves the previous page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#prev) */ prev(): Promise; } /** * Contains functionality for refining a Memberships query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryBuilder.html#) */ interface MembershipsQueryBuilder { /** * Refines a query to match items whose specified property value equals the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryBuilder.html#eq) */ eq(propertyName: string, value: any): Members.MembershipsQueryBuilder; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryBuilder.html#find) */ find(options?: Options): Promise; /** * Limits the number of items the query returns. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryBuilder.html#limit) */ limit(limit: string): Members.MembershipsQueryBuilder; /** * Refines a query to match items whose specified property value does not equal the specified value. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryBuilder.html#ne) */ ne(propertyName: string, value: any): Members.MembershipsQueryBuilder; /** * Sets the number of items to skip before returning query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryBuilder.html#skip) */ skip(skip: string): Members.MembershipsQueryBuilder; } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#) */ interface MembershipsQueryResult { /** * Returns the index of the current results page number. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#currentPage) */ readonly currentPage: number; /** * Returns the items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#items) */ readonly items: Members.Membership[]; /** * Returns the number of items in the current results page. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#length) */ readonly length: number; /** * Returns the query page size. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#pageSize) */ readonly pageSize: number; /** * Returns the `MembershipsQueryBuilder` object used to get the current results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#query) */ readonly query: Members.MembershipsQueryBuilder; /** * Returns the total number of items that match the query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#totalCount) */ readonly totalCount: number; /** * Returns the total number of pages the query produced. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#totalPages) */ readonly totalPages: number; /** * Retrieves the next page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#next) */ next(): Promise; /** * Retrieves the previous page of query results. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#prev) */ prev(): Promise; } /** * Contains functionality for refining a Members query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryBuilder.html#) */ namespace GroupMembersQueryBuilder { } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.GroupMembersQueryResult.html#) */ namespace GroupMembersQueryResult { } /** * Contains functionality for refining a Memberships query. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryBuilder.html#) */ namespace MembershipsQueryBuilder { } /** * The results of a create request query, containing the retrieved items. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Members.MembershipsQueryResult.html#) */ namespace MembershipsQueryResult { } } /** * The Roles API provides functionality for assigning and unassigning a role to a group member. * [Read more](https://www.wix.com/corvid/reference/wix-groups-backend.Roles.html#) */ namespace Roles { type Identifiers = { /** * ID of the group. */ groupId: string; /** * IDs of the site members. */ memberIds: string[]; }; } }