UNPKG

@medusajs/core-flows

Version:

Set of workflow definitions for Medusa

56 lines 2.79 kB
import { AdditionalData, ProductTypes } from "@medusajs/framework/types"; import { WorkflowData } from "@medusajs/framework/workflows-sdk"; /** * The data to update one or more product collections, along with custom data that's passed to the workflow's hooks. */ export type UpdateCollectionsWorkflowInput = { /** * The filters to select the collections to update. */ selector: ProductTypes.FilterableProductCollectionProps; /** * The data to update the collections with. */ update: ProductTypes.UpdateProductCollectionDTO; } & AdditionalData; export declare const updateCollectionsWorkflowId = "update-collections"; /** * This workflow updates one or more collections. It's used by the * [Create Collection Admin API Route](https://docs.medusajs.com/api/admin#collections_postcollectionsid). * * This workflow has a hook that allows you to perform custom actions on the updated collections. For example, you can pass under `additional_data` custom data that * allows you to update custom data models linked to the product collections. * * You can also use this workflow within your own custom workflows, allowing you to wrap custom logic around product-collection update. * * @example * const { result } = await updateCollectionsWorkflow(container) * .run({ * input: { * selector: { * id: "pcol_123" * }, * update: { * title: "Summer Collection" * }, * additional_data: { * erp_id: "123" * } * } * }) * * @summary * * Update one or more product collections. * * @property hooks.collectionsUpdated - This hook is executed after the collections are updated. You can consume this hook to perform custom actions on the updated collections. */ export declare const updateCollectionsWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<UpdateCollectionsWorkflowInput, ProductTypes.ProductCollectionDTO[], [import("@medusajs/framework/workflows-sdk").Hook<"collectionsUpdated", { additional_data: ((Record<string, unknown> | WorkflowData<Record<string, unknown> | undefined>) & Record<string, unknown>) | undefined; collections: (ProductTypes.ProductCollectionDTO | WorkflowData<ProductTypes.ProductCollectionDTO>)[] & ProductTypes.ProductCollectionDTO[] & import("@medusajs/framework/workflows-sdk").WorkflowDataProperties<ProductTypes.ProductCollectionDTO[]> & { config(config: { name?: string; } & Omit<import("@medusajs/orchestration").TransactionStepsDefinition, "next" | "uuid" | "action">): WorkflowData<ProductTypes.ProductCollectionDTO[]>; } & import("@medusajs/framework/workflows-sdk").StepFunctionReturnConfig<ProductTypes.ProductCollectionDTO[]>; }, unknown>]>; //# sourceMappingURL=update-collections.d.ts.map