UNPKG

@datocms/cma-client

Version:
97 lines (96 loc) 3.26 kB
import BaseResource from '../../BaseResource'; import type * as SchemaTypes from '../SchemaTypes'; import type * as SimpleSchemaTypes from '../SimpleSchemaTypes'; 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: SimpleSchemaTypes.WorkflowCreateSchema): Promise<SimpleSchemaTypes.Workflow>; /** * Create a new workflow * * Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/create * * @throws {ApiError} * @throws {TimeoutError} */ rawCreate(body: SchemaTypes.WorkflowCreateSchema): Promise<SchemaTypes.WorkflowCreateTargetSchema>; /** * Update a workflow * * Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/update * * @throws {ApiError} * @throws {TimeoutError} */ update(workflowId: string | SimpleSchemaTypes.WorkflowData, body: SimpleSchemaTypes.WorkflowUpdateSchema): Promise<SimpleSchemaTypes.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: SchemaTypes.WorkflowUpdateSchema): Promise<SchemaTypes.WorkflowUpdateTargetSchema>; /** * List all workflows * * Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/instances * * @throws {ApiError} * @throws {TimeoutError} */ list(): Promise<SimpleSchemaTypes.WorkflowInstancesTargetSchema>; /** * List all workflows * * Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/instances * * @throws {ApiError} * @throws {TimeoutError} */ rawList(): Promise<SchemaTypes.WorkflowInstancesTargetSchema>; /** * Retrieve a workflow * * Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/self * * @throws {ApiError} * @throws {TimeoutError} */ find(workflowId: string | SimpleSchemaTypes.WorkflowData): Promise<SimpleSchemaTypes.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<SchemaTypes.WorkflowSelfTargetSchema>; /** * Delete a workflow * * Read more: https://www.datocms.com/docs/content-management-api/resources/workflow/destroy * * @throws {ApiError} * @throws {TimeoutError} */ destroy(workflowId: string | SimpleSchemaTypes.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>; }