@datocms/cma-client
Version:
JS client for DatoCMS REST Content Management API
97 lines (96 loc) • 3.53 kB
TypeScript
import BaseResource from '../../BaseResource';
import type * as SchemaTypes from '../SchemaTypes';
import type * as SimpleSchemaTypes from '../SimpleSchemaTypes';
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 | SimpleSchemaTypes.UserData, body: SimpleSchemaTypes.UserUpdateSchema): Promise<SimpleSchemaTypes.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: SchemaTypes.UserUpdateSchema): Promise<SchemaTypes.UserUpdateTargetSchema>;
/**
* List all collaborators
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
list(): Promise<SimpleSchemaTypes.UserInstancesTargetSchema>;
/**
* List all collaborators
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawList(): Promise<SchemaTypes.UserInstancesTargetSchema>;
/**
* Retrieve a collaborator
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
find(userId: string | SimpleSchemaTypes.UserData, queryParams?: SimpleSchemaTypes.UserSelfHrefSchema): Promise<SimpleSchemaTypes.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?: SchemaTypes.UserSelfHrefSchema): Promise<SchemaTypes.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?: SimpleSchemaTypes.UserMeHrefSchema): Promise<SimpleSchemaTypes.User | SimpleSchemaTypes.SsoUser | SimpleSchemaTypes.AccessToken | SimpleSchemaTypes.Account>;
/**
* Retrieve current signed-in user
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawFindMe(queryParams?: SchemaTypes.UserMeHrefSchema): Promise<SchemaTypes.UserMeTargetSchema>;
/**
* Delete a collaborator
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
destroy(userId: string | SimpleSchemaTypes.UserData, queryParams?: SimpleSchemaTypes.UserDestroyHrefSchema): Promise<SimpleSchemaTypes.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?: SchemaTypes.UserDestroyHrefSchema): Promise<SchemaTypes.UserDestroyTargetSchema>;
}