UNPKG

@datocms/cma-client

Version:
97 lines (96 loc) 3.4 kB
import BaseResource from '../../BaseResource'; import type * as ApiTypes from '../ApiTypes'; import type * as RawApiTypes from '../RawApiTypes'; export default class User extends BaseResource { static readonly TYPE: "user"; /** * Update a collaborator * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/update * * @throws {ApiError} * @throws {TimeoutError} */ update(userId: string | ApiTypes.UserData, body: ApiTypes.UserUpdateSchema): Promise<ApiTypes.User>; /** * Update a collaborator * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/update * * @throws {ApiError} * @throws {TimeoutError} */ rawUpdate(userId: string, body: RawApiTypes.UserUpdateSchema): Promise<RawApiTypes.UserUpdateTargetSchema>; /** * List all collaborators * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/instances * * @throws {ApiError} * @throws {TimeoutError} */ list(): Promise<ApiTypes.UserInstancesTargetSchema>; /** * List all collaborators * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/instances * * @throws {ApiError} * @throws {TimeoutError} */ rawList(): Promise<RawApiTypes.UserInstancesTargetSchema>; /** * Retrieve a collaborator * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/self * * @throws {ApiError} * @throws {TimeoutError} */ find(userId: string | ApiTypes.UserData, queryParams?: ApiTypes.UserSelfHrefSchema): Promise<ApiTypes.User>; /** * Retrieve a collaborator * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/self * * @throws {ApiError} * @throws {TimeoutError} */ rawFind(userId: string, queryParams?: RawApiTypes.UserSelfHrefSchema): Promise<RawApiTypes.UserSelfTargetSchema>; /** * Retrieve current signed-in user * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/me * * @throws {ApiError} * @throws {TimeoutError} */ findMe(queryParams?: ApiTypes.UserMeHrefSchema): Promise<ApiTypes.User | ApiTypes.SsoUser | ApiTypes.AccessToken | ApiTypes.Account | ApiTypes.Organization>; /** * Retrieve current signed-in user * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/me * * @throws {ApiError} * @throws {TimeoutError} */ rawFindMe(queryParams?: RawApiTypes.UserMeHrefSchema): Promise<RawApiTypes.UserMeTargetSchema>; /** * Delete a collaborator * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/destroy * * @throws {ApiError} * @throws {TimeoutError} */ destroy(userId: string | ApiTypes.UserData, queryParams?: ApiTypes.UserDestroyHrefSchema): Promise<ApiTypes.User>; /** * Delete a collaborator * * Read more: https://www.datocms.com/docs/content-management-api/resources/user/destroy * * @throws {ApiError} * @throws {TimeoutError} */ rawDestroy(userId: string, queryParams?: RawApiTypes.UserDestroyHrefSchema): Promise<RawApiTypes.UserDestroyTargetSchema>; }