import Base, { MaybeRaw } from "../../../../../Base"; import { PaginatedResponse, SearchFilter, Sorting } from "../../../../../interfaces/global"; import { OrganizationRole } from "../../../../../interfaces/idp"; import { OrganizationMemberInvitation } from "../../../../../interfaces/idp/organization/member/invitations"; export default class IdpOrganizationMemberInvitations extends Base { /** * Retrieves all invitations sent out by the organization that match the provided search filter(s). Returns all invitations if no search filter is provided. * @param orgName Name of the organization * @param filters (optional) Array of search filters * @param sorting (optional) Sorting object * @param limit (optional) Max number of results (1-100; defaults to 25) * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0) * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page) */ search(params: { orgName: string; filters: SearchFilter[]; sorting?: Sorting; limit?: number; page?: number; }, raw?: { raw: R; }): Promise>>; /** * Invites a User to an Organization. * * @param orgName Name of the Organization * @param email Email of the person to be invited * @param role The role they will have within the organization if they accept the invitation * @param allowNonRegisteredUsers Flag to determine if the invitation should go through in the case that the email is not bound to an Helmut Cloud user. * If this is set to true and the email is unbound, then an email will be sent asking the person to register. * When they do they will automatically join the organization. * @param targetUrl Optional url the link in the mail will point to * @returns The created invitation */ create(orgName: string, email: string, role: OrganizationRole, allowNonRegisteredUsers?: boolean, targetUrl?: string, raw?: { raw: R; }): Promise>; /** * Invites list of users to an Organization. * * @param orgName Name of the Organization * @param users - List of users to be invited should contain the following data: * - email of the person to be invited * - the role they will have within the organization if they accept the invitation * - allowNonRegisteredUsers Flag to determine if the invitation should go through in the case that the email is not bound to an Helmut Cloud user. * If this is set to true and the email is unbound, then an email will be sent asking the person to register. * When they do they will automatically join the organization. * - targetUrl Optional url the link in the mail will point to * @returns The list of created invitations */ createList(orgName: string, users: Array<{ email: string; role: OrganizationRole; allowNonRegisteredUsers: false; targetUrl?: string; }>): Promise; /** * Accept an invitation. * * Internally this calls respond. * * @param orgName Name of the Organization * @param invitationId ID of the invitation * @returns The patched invitation */ accept(orgName: string, invitationId: string, raw?: { raw: R; }): Promise>; /** * Reject an invitation. * * Internally this calls respond. * * @param orgName Name of the Organization * @param invitationId ID of the invitation * @returns The patched invitation */ reject(orgName: string, invitationId: string, raw?: { raw: R; }): Promise>; /** * Respond to an invitation. * * @param orgName Name of the Organization * @param invitationId ID of the invitation * @param accept Whether or not to accept the invitation * @returns The patched invitation */ respond(orgName: string, invitationId: string, accept: boolean, raw?: { raw: R; }): Promise>; /** * Resends an invitation email. * * @param orgName Name of the Organization * @param invitationId ID of the invitation */ resendInvitationEmail(orgName: string, invitationId: string, raw?: { raw: R; }): Promise>; /** * Cancel/Delete an invitation. * * @param orgName Name of the Organization * @param invitationId ID of the invitation */ delete(orgName: string, invitationId: string, raw?: { raw: R; }): Promise>; protected getEndpoint(endpoint: string): string; }