import type { Group, DatabaseStore, PaginationParams, Response, GroupMembership } from '../../typings'; import { Base } from './Base'; interface CreateGroupParams { directoryId: string; name: string; raw: any; id?: string; } export declare class Groups extends Base { constructor({ db }: { db: DatabaseStore; }); create(params: CreateGroupParams): Promise>; /** * @openapi * components: * schemas: * Group: * type: object * properties: * id: * type: string * description: Group ID * name: * type: string * description: Group name * raw: * type: object * properties: {} * description: Raw group attributes from the Identity Provider * Member: * type: object * properties: * user_id: * type: string * description: ID of the user * parameters: * groupId: * name: groupId * in: path * description: Group ID * required: true * schema: * type: string * */ /** * @openapi * /api/v1/dsync/groups/{groupId}: * get: * tags: * - Directory Sync * summary: Get group by id from a directory * parameters: * - name: tenant * in: query * description: Tenant (Optional if directoryId is provided) * schema: * type: string * - name: product * in: query * description: Product (Optional if directoryId is provided) * schema: * type: string * - name: directoryId * in: query * description: Directory ID (Optional if tenant/product is provided) * schema: * type: string * - name: groupId * in: path * description: Group ID * required: true * schema: * type: string * responses: * 200: * description: Success * content: * application/json: * schema: * $ref: "#/components/schemas/Group" * x-ory-ratelimit-bucket: polis-public-low */ get(id: string): Promise>; update(id: string, param: { name: string; raw: any; }): Promise>; delete(id: string): Promise>; addUserToGroup(groupId: string, userId: string): Promise; removeUserFromGroup(groupId: string, userId: string): Promise; isUserInGroup(groupId: string, userId: string): Promise; search(displayName: string, directoryId: string): Promise>; /** * @openapi * /api/v1/dsync/groups: * get: * tags: * - Directory Sync * summary: Get groups from a directory * parameters: * - $ref: '#/components/parameters/tenant' * - $ref: '#/components/parameters/product' * - $ref: '#/components/parameters/directoryId' * - $ref: '#/components/parameters/pageOffset' * - $ref: '#/components/parameters/pageLimit' * - $ref: '#/components/parameters/pageToken' * responses: * 200: * description: Success * content: * application/json: * schema: * type: object * properties: * data: * type: array * items: * $ref: '#/components/schemas/Group' * pageToken: * type: string * description: token for pagination * x-ory-ratelimit-bucket: polis-public-low */ getAll(params: PaginationParams & { directoryId?: string; }): Promise>; /** * @openapi * /api/v1/dsync/groups/{groupId}/members: * get: * tags: * - Directory Sync * summary: Get list of members in a group * parameters: * - $ref: '#/components/parameters/tenant' * - $ref: '#/components/parameters/product' * - $ref: '#/components/parameters/groupId' * - $ref: '#/components/parameters/directoryId' * - $ref: '#/components/parameters/pageOffset' * - $ref: '#/components/parameters/pageLimit' * - $ref: '#/components/parameters/pageToken' * responses: * 200: * description: Success * content: * application/json: * schema: * type: object * properties: * data: * type: array * items: * $ref: '#/components/schemas/Member' * x-ory-ratelimit-bucket: polis-public-low */ getGroupMembers(parmas: { groupId: string; } & PaginationParams): Promise[]>>; deleteAll(directoryId: string): Promise; removeAllUsers(groupId: string): Promise; } export {};