@datocms/cma-client
Version:
JS client for DatoCMS REST Content Management API
97 lines (96 loc) • 3.17 kB
TypeScript
import BaseResource from '../../BaseResource';
import type * as ApiTypes from '../ApiTypes';
import type * as RawApiTypes from '../RawApiTypes';
export default class Workflow extends BaseResource {
static readonly TYPE: "workflow";
/**
* Create a new workflow
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/create
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
create(body: ApiTypes.WorkflowCreateSchema): Promise<ApiTypes.Workflow>;
/**
* Create a new workflow
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/create
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawCreate(body: RawApiTypes.WorkflowCreateSchema): Promise<RawApiTypes.WorkflowCreateTargetSchema>;
/**
* Update a workflow
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
update(workflowId: string | ApiTypes.WorkflowData, body: ApiTypes.WorkflowUpdateSchema): Promise<ApiTypes.Workflow>;
/**
* Update a workflow
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawUpdate(workflowId: string, body: RawApiTypes.WorkflowUpdateSchema): Promise<RawApiTypes.WorkflowUpdateTargetSchema>;
/**
* List all workflows
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
list(): Promise<ApiTypes.WorkflowInstancesTargetSchema>;
/**
* List all workflows
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawList(): Promise<RawApiTypes.WorkflowInstancesTargetSchema>;
/**
* Retrieve a workflow
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
find(workflowId: string | ApiTypes.WorkflowData): Promise<ApiTypes.Workflow>;
/**
* Retrieve a workflow
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawFind(workflowId: string): Promise<RawApiTypes.WorkflowSelfTargetSchema>;
/**
* Delete a workflow
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
destroy(workflowId: string | ApiTypes.WorkflowData): Promise<void>;
/**
* Delete a workflow
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawDestroy(workflowId: string): Promise<void>;
}