/** * 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. */ export interface JoinGroupRequest { /** * Member ID. See the Members API for more details. * @readonly */ siteMemberId?: string; /** * Contact ID. See the Contacts API for more details. * @readonly */ contactId?: string; /** Join group request status. */ status?: RequestStatus; /** Join group request details. */ requestDetails?: RequestDetails; } export declare enum RequestStatus { /** Pending group request. */ PENDING = "PENDING", /** Approved group request. */ APPROVED = "APPROVED", /** Rejected group request. */ REJECTED = "REJECTED", /** Canceled group request. */ CANCELED = "CANCELED" } export interface RequestDetails { /** Reason the request has been rejected. */ rejectionReason?: string | null; } export interface SocialGroupsEvent extends SocialGroupsEventPayloadOneOf { memberJoined?: MemberJoinedGroup; membersAdded?: MembersAddedToGroup; joinRequestsApproved?: JoinRequestsApproved; membersInvited?: MembersInvitedToGroup; } /** @oneof */ export interface SocialGroupsEventPayloadOneOf { memberJoined?: MemberJoinedGroup; membersAdded?: MembersAddedToGroup; joinRequestsApproved?: JoinRequestsApproved; membersInvited?: MembersInvitedToGroup; } export interface MemberJoinedGroup { groupId?: string; groupsInstanceId?: string; siteMemberId?: string; } export interface MembersAddedToGroup { groupId?: string; groupsInstanceId?: string; whoAddedId?: string | null; siteMemberIds?: string[]; /** Used for Apes sticky experiment */ operationId?: string; } export interface JoinRequestsApproved { groupId?: string; groupsInstanceId?: string; siteMemberIds?: string[]; /** Used for Apes sticky experiment */ operationId?: string; } export interface MembersInvitedToGroup { groupId?: string; groupsInstanceId?: string; siteMemberIds?: string[]; } export interface GetJoinRequirementsRequest { /** Group ID. */ 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[]; autoInviteId?: string | null; } /** Answer to a membership question. */ export interface MembershipQuestionAnswer { /** Question ID. */ _id?: string; /** Answer text. */ text?: string | null; } export interface GetJoinRequirementsResponse { violation?: Violation; } export interface PaidPlan { planId?: string; name?: string; startsAt?: Date | null; } export declare enum ViolationType { NONE = "NONE", NOT_LOGGED_IN = "NOT_LOGGED_IN", ALREADY_JOINED = "ALREADY_JOINED", SECRET_GROUP = "SECRET_GROUP", EVENTS = "EVENTS", PRICING_PlANS = "PRICING_PlANS", MEMBERSHIP_QUESTIONS = "MEMBERSHIP_QUESTIONS", ADMIN_APPROVAL = "ADMIN_APPROVAL" } export interface EventsViolationOptions { /** Events which allow user to join the group. */ eventIds?: string[]; } export interface PricingPlanViolationOptions { installed?: boolean; /** Plan ids which allow user to join the group. */ requiredPlans?: PaidPlan[]; /** Plan ids which user have, but they don't allow to join group right now, because they start some time in the future. */ futurePlans?: PaidPlan[]; } export interface MembershipQuestionViolationOptions { requiredQuestionIds?: string[]; } export interface Violation extends ViolationViolationOptionsOneOf { eventsOptions?: EventsViolationOptions; pricingPlansOptions?: PricingPlanViolationOptions; membershipQuestionsOptions?: MembershipQuestionViolationOptions; violationType?: ViolationType; } /** @oneof */ export interface ViolationViolationOptionsOneOf { eventsOptions?: EventsViolationOptions; pricingPlansOptions?: PricingPlanViolationOptions; membershipQuestionsOptions?: MembershipQuestionViolationOptions; } export interface SubmitJoinGroupRequestRequest { /** 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[]; } export interface SubmitJoinGroupRequestResponse { /** Submitted join group request. */ joinGroupRequest?: JoinGroupRequest; } export interface CancelJoinGroupRequestRequest { /** Relevant group. */ groupId?: string; } export interface CancelJoinGroupRequestResponse { /** Cancelled join group request. */ joinGroupRequest?: JoinGroupRequest; } export interface JoinGroupRequestCancelled { /** Group ID for which join request was cancelled. */ groupId?: string; /** Cancelled join group request. */ joinGroupRequest?: JoinGroupRequest; } export interface ApproveJoinGroupRequestsRequest { /** ID of the group requested to join. */ groupId: string; /** IDs of the site members to approve. */ memberIds?: string[]; } export 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" } export interface ApproveJoinGroupRequestsResponse { /** Approved join group requests. */ joinGroupRequests?: JoinGroupRequest[]; } export interface JoinGroupRequestApproved { /** Group ID for which join request was approved. */ groupId?: string; /** Approved join group request. */ joinGroupRequest?: JoinGroupRequest; } export interface RejectJoinGroupRequestsRequest { /** ID of the group requested to join. */ groupId: string; /** Rejection info. */ rejections?: Rejection[]; } export interface Rejection { /** Member ID to reject. */ memberId?: string; /** Rejection reason. Free text that will be displayed to the rejected site member. Limited to 1,000 characters. */ reason?: string | null; } export interface RejectJoinGroupRequestsResponse { /** Rejected join group requests. */ joinGroupRequests?: JoinGroupRequest[]; } export interface JoinGroupRequestRejected { /** Group ID for which join request was rejected. */ groupId?: string; /** Rejected join group request. */ joinGroupRequest?: JoinGroupRequest; } export interface ListJoinGroupRequestsRequest { /** Group ID. */ groupId: string; /** Maximum number of join group requests to retrieve. Defaults to 100. */ limit?: number | null; /** Number of join group requests to skip in the list. */ offset?: number | null; } export declare enum OwnershipFilter { /** All items. */ ALL = "ALL", /** Items for the current site member. */ CURRENT_MEMBER = "CURRENT_MEMBER" } export interface ListJoinGroupRequestsResponse { /** Retrieved join group requests. */ joinGroupRequests?: JoinGroupRequest[]; metadata?: PagingMetadata; } export interface PagingMetadata { /** Number of items in the current results page. */ 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; } export interface QueryJoinGroupRequestsRequest { /** Group ID. */ groupId: string; query?: Query; } export 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[]; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } export interface QueryJoinGroupRequestsResponse { /** Requests to join a group. */ joinGroupRequests?: JoinGroupRequest[]; metadata?: PagingMetadata; } export interface RejectAllJoinGroupRequestsRequest { } export interface RejectAllJoinGroupRequestsResponse { /** Rejected join group requests. */ joinGroupRequests?: JoinGroupRequest[]; } export interface ApproveAllJoinGroupRequestsRequest { } export interface ApproveAllJoinGroupRequestsResponse { /** Rejected join group requests. */ joinGroupRequests?: JoinGroupRequest[]; } export interface ListAllJoinGroupRequestsRequest { query?: Query; } export interface ListAllJoinGroupRequestsResponse { /** Join group requests. */ joinGroupRequests?: JoinGroupRequest[]; metadata?: PagingMetadata; } export 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 */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entity?: string; } export interface RestoreInfo { deletedDate?: Date | null; } export 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; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntity?: string | null; } export interface ActionEvent { body?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export 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 */ export 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; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface JoinGroupRequestNonNullableFields { siteMemberId: string; contactId: string; status: RequestStatus; } export interface ApproveJoinGroupRequestsResponseNonNullableFields { joinGroupRequests: JoinGroupRequestNonNullableFields[]; } export interface RejectJoinGroupRequestsResponseNonNullableFields { joinGroupRequests: JoinGroupRequestNonNullableFields[]; } export interface ListJoinGroupRequestsResponseNonNullableFields { joinGroupRequests: JoinGroupRequestNonNullableFields[]; } export interface QueryJoinGroupRequestsResponseNonNullableFields { joinGroupRequests: JoinGroupRequestNonNullableFields[]; } export interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } export 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; } export interface JoinGroupRequestApprovedEnvelope { data: JoinGroupRequestApproved; metadata: EventMetadata; } /** * Triggered when a join group request is approved. * @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @permissionId SOCIAL-GROUPS.MANAGE * @webhook * @eventType wix.social_groups.v2.join_group_request_approved */ export declare function onJoinGroupRequestApproved(handler: (event: JoinGroupRequestApprovedEnvelope) => void | Promise): void; export interface JoinGroupRequestCreatedEnvelope { entity: JoinGroupRequest; metadata: EventMetadata; } /** @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @permissionId SOCIAL-GROUPS.MANAGE * @webhook * @eventType wix.social_groups.v2.join_group_request_created * @documentationMaturity preview */ export declare function onJoinGroupRequestCreated(handler: (event: JoinGroupRequestCreatedEnvelope) => void | Promise): void; export interface JoinGroupRequestRejectedEnvelope { data: JoinGroupRequestRejected; metadata: EventMetadata; } /** * Triggered when a join group request is rejected. * @permissionScope Manage Social Groups * @permissionScopeId SCOPE.DC-MANAGE.SOCIAL-GROUPS * @permissionId SOCIAL-GROUPS.MANAGE * @webhook * @eventType wix.social_groups.v2.join_group_request_rejected */ export declare function onJoinGroupRequestRejected(handler: (event: JoinGroupRequestRejectedEnvelope) => void | Promise): void; /** * Approves pending join group 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 memberIds - IDs of the site members to approve. * @public * @requiredField groupId * @requiredField memberIds * @param groupId - ID of the group requested to join. * @fqn wix.social.groups.api.v2.JoinGroupRequestsService.ApproveJoinGroupRequests */ export declare function approveJoinGroupRequests(groupId: string, memberIds: string[]): Promise; /** * Rejects pending join group 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 rejections - Rejection info. * @public * @requiredField groupId * @requiredField rejections * @param groupId - ID of the group requested to join. * @fqn wix.social.groups.api.v2.JoinGroupRequestsService.RejectJoinGroupRequests */ export declare function rejectJoinGroupRequests(groupId: string, rejections: Rejection[]): Promise; /** * Lists requests to join a group. * * > **Note:** This function is only relevant for private groups. * * The `listjoinGroupRequests()` function returns a Promise that resolves to a list of up to 100 requests to join a group. Sorts by default to `_createdDate` in descending order. * Only group admins can see requests to join their group. Site members can access their own join requests in their site. * * > **Notes:** * * @public * @requiredField groupId * @param groupId - ID of the group requested to join. * @fqn wix.social.groups.api.v2.JoinGroupRequestsService.ListJoinGroupRequests */ export declare function listJoinGroupRequests(groupId: string, options?: ListJoinGroupRequestsOptions): Promise; export interface ListJoinGroupRequestsOptions { /** Maximum number of join group requests to retrieve. Defaults to 100. */ limit?: number | null; /** Number of join group requests to skip in the list. */ offset?: number | null; } /** * Creates a query to retrieve a list of join requests. * * > **Notes:** * > + This function is only relevant for private groups. * > + For `SECRET` groups, only group admins can query requests to join their group. * * The `queryjoinGroupRequests()` function builds a query to retrieve a list of all requests to join a group, and returns a `JoinGroupRequestsQueryBuilder` object. * * The returned object contains the query definition which is typically used to run the query using the [`find()`](/join-group-requests-query-builder/find) function. * * You can refine the query by chaining `joinGroupRequestsQueryBuilder` functions onto the query. `joinGroupRequestsQueryBuilder` functions enable you to sort, filter, and control the results that `queryjoinGroupRequests()` returns. * * The results of the `queryjoinGroupRequests()` function are sorted by `_createdDate` in descending order. * * `queryjoinGroupRequests()` runs with this `joinGroupRequestsQueryBuilder` default, which you can override: * + [`limit(100)`](/join-group-requests-query-builder/limit) * * The following `joinGroupRequestsQueryBuilder` functions are supported for `queryjoinGroupRequests()`. For a full description of the joinGroupRequests object, see the object returned for the [`items`](/join-group-requests-query-result/items) property in `JoinGroupRequestsQueryResult`. * * @public * @requiredField groupId * @param groupId - Group ID. * @fqn wix.social.groups.api.v2.JoinGroupRequestsService.QueryJoinGroupRequests */ export declare function queryJoinGroupRequests(groupId: string, options?: QueryJoinGroupRequestsOptions): JoinGroupRequestsQueryBuilder; export interface QueryJoinGroupRequestsOptions { } interface QueryOffsetResult { currentPage: number | undefined; totalPages: number | undefined; totalCount: number | undefined; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } export interface JoinGroupRequestsQueryResult extends QueryOffsetResult { items: JoinGroupRequest[]; query: JoinGroupRequestsQueryBuilder; next: () => Promise; prev: () => Promise; } export interface JoinGroupRequestsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: 'status', value: any) => JoinGroupRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: 'status', value: any) => JoinGroupRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasSome: (propertyName: 'status', value: any[]) => JoinGroupRequestsQueryBuilder; in: (propertyName: 'status', value: any) => JoinGroupRequestsQueryBuilder; exists: (propertyName: 'status', value: boolean) => JoinGroupRequestsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => JoinGroupRequestsQueryBuilder; /** @param skip - Number of items to skip in the query results before returning the results. */ skip: (skip: number) => JoinGroupRequestsQueryBuilder; find: () => Promise; } export {};