/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { workflowsCreate } from "../funcs/workflowsCreate.js"; import { workflowsDelete } from "../funcs/workflowsDelete.js"; import { workflowsGet } from "../funcs/workflowsGet.js"; import { workflowsList } from "../funcs/workflowsList.js"; import { workflowsPatch } from "../funcs/workflowsPatch.js"; import { workflowsSync } from "../funcs/workflowsSync.js"; import { workflowsUpdate } from "../funcs/workflowsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { Steps } from "./steps.js"; export class Workflows extends ClientSDK { private _steps?: Steps; get steps(): Steps { return (this._steps ??= new Steps(this._options)); } /** * Create a workflow * * @remarks * Creates a new workflow in the Novu Cloud environment */ async create( createWorkflowDto: components.CreateWorkflowDto, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(workflowsCreate( this, createWorkflowDto, idempotencyKey, options, )); } /** * List all workflows * * @remarks * Retrieves a list of workflows with optional filtering and pagination */ async list( request: operations.WorkflowControllerSearchWorkflowsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(workflowsList( this, request, options, )); } /** * Update a workflow * * @remarks * Updates the details of an existing workflow, here **workflowId** is the identifier of the workflow */ async update( updateWorkflowDto: components.UpdateWorkflowDto, workflowId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(workflowsUpdate( this, updateWorkflowDto, workflowId, idempotencyKey, options, )); } /** * Retrieve a workflow * * @remarks * Fetches details of a specific workflow by its unique identifier **workflowId** */ async get( workflowId: string, environmentId?: string | undefined, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(workflowsGet( this, workflowId, environmentId, idempotencyKey, options, )); } /** * Delete a workflow * * @remarks * Removes a specific workflow by its unique identifier **workflowId** */ async delete( workflowId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(workflowsDelete( this, workflowId, idempotencyKey, options, )); } /** * Update a workflow * * @remarks * Partially updates a workflow by its unique identifier **workflowId** */ async patch( patchWorkflowDto: components.PatchWorkflowDto, workflowId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(workflowsPatch( this, patchWorkflowDto, workflowId, idempotencyKey, options, )); } /** * Sync a workflow * * @remarks * Synchronizes a workflow to the target environment */ async sync( syncWorkflowDto: components.SyncWorkflowDto, workflowId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(workflowsSync( this, syncWorkflowDto, workflowId, idempotencyKey, options, )); } }