fix(core-flows,types): change doc for upload file functions (#13809)

* fix(core-flows,types): change doc for upload file functions

* Create silent-seas-hammer.md

* comment

* comment
This commit is contained in:
William Bouchard authored and GitHub committed 2025-11-07 10:12:57 +01:00
1 parent 6cd40c9f74
commit a9d33bc8d1
6 files changed
+16 -10

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
---
"@medusajs/core-flows": patch
"@medusajs/types": patch
---
fix(core-flows,types): change doc for upload file functions
@@ -1,6 +1,6 @@
import type { IFileModuleService } from "@medusajs/framework/types" import type { IFileModuleService } from "@medusajs/framework/types"
import { Modules } from "@medusajs/framework/utils" import { Modules } from "@medusajs/framework/utils"
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk" import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
/** /**
* The data to upload files. * The data to upload files.
@@ -23,7 +23,7 @@ export type UploadFilesStepInput = {
mimeType: string mimeType: string
/** /**
* The content of the file. For images, for example, * The content of the file. For images, for example,
* use binary string. For CSV files, use the CSV content. * use base64 string. For CSV files, use the CSV content.
*/ */
content: string content: string
/** /**
@@ -48,7 +48,7 @@ export const uploadFilesStepId = "upload-files"
* { * {
* filename: "test.jpg", * filename: "test.jpg",
* mimeType: "img/jpg", * mimeType: "img/jpg",
* content: "binary-string", * content: "base64-string",
* access: "public" * access: "public"
* } * }
* ] * ]
@@ -1,8 +1,8 @@
import type { FileDTO } from "@medusajs/framework/types" import type { FileDTO } from "@medusajs/framework/types"
import { import {
createWorkflow,
WorkflowData, WorkflowData,
WorkflowResponse, WorkflowResponse,
createWorkflow,
} from "@medusajs/framework/workflows-sdk" } from "@medusajs/framework/workflows-sdk"
import { uploadFilesStep } from "../steps" import { uploadFilesStep } from "../steps"
@@ -27,7 +27,7 @@ export type UploadFilesWorkflowInput = {
mimeType: string mimeType: string
/** /**
* The content of the file. For images, for example, * The content of the file. For images, for example,
* use binary string. For CSV files, use the CSV content. * use base64 string. For CSV files, use the CSV content.
*/ */
content: string content: string
/** /**
@@ -58,7 +58,7 @@ export const uploadFilesWorkflowId = "upload-files"
* { * {
* filename: "test.jpg", * filename: "test.jpg",
* mimeType: "img/jpg", * mimeType: "img/jpg",
* content: "binary-string", * content: "base64-string",
* access: "public" * access: "public"
* } * }
* ] * ]
+1 -1
View File
@@ -18,7 +18,7 @@ export interface CreateFileDTO {
mimeType: string mimeType: string
/** /**
* The file content as a binary-encoded string. * The file content as a base64-encoded string.
*/ */
content: string content: string
+1 -1
View File
@@ -72,7 +72,7 @@ export type ProviderUploadFileDTO = {
mimeType: string mimeType: string
/** /**
* The file content as a binary-encoded string * The file content as a base64-encoded string
*/ */
content: string content: string
+2 -2
View File
@@ -30,7 +30,7 @@ export interface IFileModuleService extends IModuleService {
* const [file] = await fileModuleService.createFiles([{ * const [file] = await fileModuleService.createFiles([{
* filename: "product.png", * filename: "product.png",
* mimeType: "image/png", * mimeType: "image/png",
* content: "somecontent" // binary string * content: "somecontent" // base64 string
* }]) * }])
*/ */
createFiles( createFiles(
@@ -49,7 +49,7 @@ export interface IFileModuleService extends IModuleService {
* const file = await fileModuleService.createFiles({ * const file = await fileModuleService.createFiles({
* filename: "product.png", * filename: "product.png",
* mimeType: "image/png", * mimeType: "image/png",
* content: "somecontent" // binary string * content: "somecontent" // base64 string
* }) * })
*/ */