UNPKG

@itwin/access-control-client

Version:

Access control client for the iTwin platform

69 lines 3.28 kB
/** @packageDocumentation * @module AccessControlClient */ import type { AccessToken } from "@itwin/core-bentley"; import type { IOwnerMembersClient } from "../accessControlClientInterfaces/OwnerMembersClient "; import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes"; import type { OwnerMember } from "../types/Members"; import type { AddOwnerMemberResponse, OwnerMemberMultiResponse } from "../types/OwnerMember"; import { BaseClient } from "./BaseClient"; /** Client API to perform owner member operations. */ export declare class OwnerMembersClient extends BaseClient implements IOwnerMembersClient { /** Create a new OwnerMembersClient instance * @param url Optional base URL for the access control service. If not provided, defaults to base url. */ constructor(url?: string); /** Retrieves a list of iTwin owner members on an iTwin. * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @param arg Optional query parameters for pagination (top, skip) * @returns Array of owner members, including any "missing users" with null profile data * @remarks * **Missing Users** * * When members are removed from the Bentley Identity Management System, they are not * automatically removed from the iTwin. Therefore, it is possible to have a situation * where the user is no longer valid, yet they are still a member of the iTwin. When * this happens, the user member will be returned from this API endpoint with the * following values: * * ```json * { * "id": "<memberId>", * "email": null, * "givenName": null, * "surname": null, * "organization": null, * ... * } * ``` * * You should account for this in your software if you do not want to show these users. * * **Cleanup** * * The Access Control API will perform a once-a-week cleanup to remove these "Missing Users". * You can rely on this automated clean-up if this timeline is sufficient. * * If not, you can use the Remove iTwin Owner Member API (use the memberId) to remove * the owner member from the iTwin. * */ queryITwinOwnerMembers(accessToken: AccessToken, iTwinId: string, arg?: Pick<ODataQueryParams, "top" | "skip">): Promise<BentleyAPIResponse<OwnerMemberMultiResponse>>; /** Add new iTwin owner member. * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @param newMember The new owner member to add or invite * @returns AddOwnerMemberResponse -- the added or invited owner */ addITwinOwnerMember(accessToken: AccessToken, iTwinId: string, newMember: Pick<OwnerMember, "email">): Promise<BentleyAPIResponse<AddOwnerMemberResponse>>; /** Remove the specified owner member from the iTwin * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @param memberId The id of the member * @returns No Content */ removeITwinOwnerMember(accessToken: AccessToken, iTwinId: string, memberId: string): Promise<BentleyAPIResponse<undefined>>; } //# sourceMappingURL=OwnerMembersClient.d.ts.map