/** * To join a private group, a site member must submit a Join Request, which can be approved or rejected by an admin. * When the request is approved, the site member becomes a group member. */ interface JoinRequest { /** * Member ID. See [Members API](https://dev.wix.com/api/rest/members/members/about-wix-members) for more details. * @readonly */ memberId?: string; /** * Join request status. * - `PENDING` - Pending join request. * - `APPROVED` - Approved join request. * - `REJECTED` - Rejected join request. * - `CANCELED` - Canceled join request. */ status?: RequestStatus; /** Join request details. */ requestDetails?: RequestDetails; } declare enum RequestStatus { /** Undefined request status. */ UNKNOWN_STATUS = "UNKNOWN_STATUS", /** Pending group request. */ PENDING = "PENDING", /** Approved group request. */ APPROVED = "APPROVED", /** Rejected group request. */ REJECTED = "REJECTED", /** Cancelled group request. */ CANCELLED = "CANCELLED", /** Canceled group request. */ CANCELED = "CANCELED" } interface RequestDetails { /** Reason the request has been rejected. */ rejectionReason?: string | null; } interface SubmitJoinRequestRequest { /** Relevant group. */ groupId?: string; /** Answers to membership questions. They can be empty, but submit join group request will fail if an answer to a required question is omitted. */ membershipQuestionAnswers?: MembershipQuestionAnswer[]; } /** Answer to a membership question. */ interface MembershipQuestionAnswer { /** Question ID. */ _id?: string; /** Answer text. */ text?: string | null; } interface SubmitJoinRequestResponse { /** Submitted join request. */ joinRequest?: JoinRequest; } interface CancelJoinRequestRequest { /** Relevant group. */ groupId?: string; } interface CancelJoinRequestResponse { /** Cancelled join request. */ joinRequest?: JoinRequest; } interface JoinRequestCancelled { /** Group ID for which join request was cancelled. */ groupId?: string; /** Cancelled join request. */ joinRequest?: JoinRequest; } interface ApproveJoinRequestsRequest { /** Relevant group. */ groupId: string; /** Member IDs to approve. */ memberIds: string[]; } declare enum ItemsToUpdate { /** Take into account only items which are listed in the request. */ BY_ID = "BY_ID", /** Update all items. */ ALL_ITEMS = "ALL_ITEMS" } interface ApproveJoinRequestsResponse { /** Approved join requests. */ joinRequests?: JoinRequest[]; } interface JoinRequestApproved { /** Group ID for which join request was approved. */ groupId?: string; /** Approved join request. */ joinRequest?: JoinRequest; } interface RejectJoinRequestsRequest { /** Relevant group. */ groupId: string; /** Rejection data. */ rejections?: Rejection[]; } interface Rejection { /** Member ID to reject. */ memberId?: string; /** Rejection reason. Free text that will be displayed to the rejected site member (max 1,000 characters). */ reason?: string | null; } interface RejectJoinRequestsResponse { /** Rejected join requests. */ joinRequests?: JoinRequest[]; } interface JoinRequestRejected { /** Group ID for which join request was rejected. */ groupId?: string; /** Rejected join request. */ joinRequest?: JoinRequest; } interface ListJoinRequestsRequest { /** Group ID. */ groupId: string; limit?: number | null; offset?: number | null; } declare enum OwnershipFilter { /** All items. */ ALL = "ALL", /** Items for the current site member. */ CURRENT_MEMBER = "CURRENT_MEMBER" } interface ListJoinRequestsResponse { /** Join requests. */ joinRequests?: JoinRequest[]; 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 QueryJoinRequestsRequest { /** Group ID. */ groupId: string; query?: Query; } 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. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } declare enum SortOrder { ASC = "ASC", DESC = "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 QueryJoinRequestsResponse { /** Join requests. */ joinRequests?: JoinRequest[]; metadata?: PagingMetadata; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ 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. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface JoinRequestNonNullableFields { memberId: string; status: RequestStatus; } interface ApproveJoinRequestsResponseNonNullableFields { joinRequests: JoinRequestNonNullableFields[]; } interface RejectJoinRequestsResponseNonNullableFields { joinRequests: JoinRequestNonNullableFields[]; } interface ListJoinRequestsResponseNonNullableFields { joinRequests: JoinRequestNonNullableFields[]; } interface QueryJoinRequestsResponseNonNullableFields { joinRequests: JoinRequestNonNullableFields[]; } interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } interface EventMetadata extends BaseEventMetadata { /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } interface JoinRequestApprovedEnvelope { data: JoinRequestApproved; metadata: EventMetadata; } /** * Triggered when a join request is approved by a group admin or a groups manager. * @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @permissionId SOCIAL-GROUPS.MANAGE * @webhook * @eventType wix.social_groups.v3.join_request_approved * @documentationMaturity preview */ declare function onJoinRequestApproved(handler: (event: JoinRequestApprovedEnvelope) => void | Promise): void; interface JoinRequestRejectedEnvelope { data: JoinRequestRejected; metadata: EventMetadata; } /** * Triggered when a join group request is rejected by a group admin or a groups manager. * @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @permissionId SOCIAL-GROUPS.MANAGE * @webhook * @eventType wix.social_groups.v3.join_request_rejected * @documentationMaturity preview */ declare function onJoinRequestRejected(handler: (event: JoinRequestRejectedEnvelope) => void | Promise): void; /** * Approves pending join requests. * Group managers always have access to this functionality. In some cases, site owners will allow group members to use this functionality as well. * @param groupId - Relevant group. * @public * @documentationMaturity preview * @requiredField groupId * @requiredField options * @requiredField options.memberIds * @permissionId SOCIAL-GROUPS.MANAGE * @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @applicableIdentity APP */ declare function approveJoinRequests(groupId: string, options: ApproveJoinRequestsOptions): Promise; interface ApproveJoinRequestsOptions { /** Member IDs to approve. */ memberIds: string[]; } /** * Rejects pending join requests. * Group managers always have access to this functionality. In some cases, site owners will allow group members to use this functionality as well. * @param groupId - Relevant group. * @public * @documentationMaturity preview * @requiredField groupId * @permissionId SOCIAL-GROUPS.MANAGE * @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @applicableIdentity APP */ declare function rejectJoinRequests(groupId: string, options?: RejectJoinRequestsOptions): Promise; interface RejectJoinRequestsOptions { /** Rejection data. */ rejections?: Rejection[]; } /** * Retrieves a list of up to 100 join requests, given the provided paging. * Group managers always have access to this functionality (site members can access their own join requests in the site). * @param groupId - Group ID. * @public * @documentationMaturity preview * @requiredField groupId * @permissionId SOCIAL-GROUPS.MANAGE * @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @applicableIdentity APP */ declare function listJoinRequests(groupId: string, options?: ListJoinRequestsOptions): Promise; interface ListJoinRequestsOptions { limit?: number | null; offset?: number | null; } /** * Retrieves a list of up to 100 join requests, given the provided paging and filtering. * Group managers always have access to this functionality (site members can access their own join requests in the site). * * Supported fields for filtering: * - `status` * * No supported fields for sorting * @param groupId - Group ID. * @public * @documentationMaturity preview * @requiredField groupId * @permissionId SOCIAL-GROUPS.MANAGE * @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @applicableIdentity APP */ declare function queryJoinRequests(groupId: string, options?: QueryJoinRequestsOptions): Promise; interface QueryJoinRequestsOptions { query?: Query; } export { type ActionEvent, type ApproveJoinRequestsOptions, type ApproveJoinRequestsRequest, type ApproveJoinRequestsResponse, type ApproveJoinRequestsResponseNonNullableFields, type BaseEventMetadata, type CancelJoinRequestRequest, type CancelJoinRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type IdentificationData, type IdentificationDataIdOneOf, ItemsToUpdate, type JoinRequest, type JoinRequestApproved, type JoinRequestApprovedEnvelope, type JoinRequestCancelled, type JoinRequestRejected, type JoinRequestRejectedEnvelope, type ListJoinRequestsOptions, type ListJoinRequestsRequest, type ListJoinRequestsResponse, type ListJoinRequestsResponseNonNullableFields, type MembershipQuestionAnswer, type MessageEnvelope, OwnershipFilter, type Paging, type PagingMetadata, type Query, type QueryJoinRequestsOptions, type QueryJoinRequestsRequest, type QueryJoinRequestsResponse, type QueryJoinRequestsResponseNonNullableFields, type RejectJoinRequestsOptions, type RejectJoinRequestsRequest, type RejectJoinRequestsResponse, type RejectJoinRequestsResponseNonNullableFields, type Rejection, type RequestDetails, RequestStatus, type RestoreInfo, SortOrder, type Sorting, type SubmitJoinRequestRequest, type SubmitJoinRequestResponse, WebhookIdentityType, approveJoinRequests, listJoinRequests, onJoinRequestApproved, onJoinRequestRejected, queryJoinRequests, rejectJoinRequests };