UNPKG

@medusajs/core-flows

Version:

Set of workflow definitions for Medusa

37 lines 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.uploadFilesWorkflow = exports.uploadFilesWorkflowId = void 0; const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk"); const steps_1 = require("../steps"); exports.uploadFilesWorkflowId = "upload-files"; /** * This workflow uploads one or more files using the installed * [File Module Provider](https://docs.medusajs.com/resources/infrastructure-modules/file). The workflow is used by the * [Upload Files Admin API Route](https://docs.medusajs.com/api/admin#uploads_postuploads). * * You can use this workflow within your customizations or your own custom workflows, allowing you to * upload files within your custom flows. * * @example * const { result } = await uploadFilesWorkflow(container) * .run({ * input: { * files: [ * { * filename: "test.jpg", * mimeType: "img/jpg", * content: "binary-string", * access: "public" * } * ] * } * }) * * @summary * * Upload files using the installed File Module Provider. */ exports.uploadFilesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.uploadFilesWorkflowId, (input) => { return new workflows_sdk_1.WorkflowResponse((0, steps_1.uploadFilesStep)(input)); }); //# sourceMappingURL=upload-files.js.map