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:
6
.changeset/silent-seas-hammer.md
Normal file
6
.changeset/silent-seas-hammer.md
Normal 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 { 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.
|
||||
@@ -23,7 +23,7 @@ export type UploadFilesStepInput = {
|
||||
mimeType: string
|
||||
/**
|
||||
* 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
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ export const uploadFilesStepId = "upload-files"
|
||||
* {
|
||||
* filename: "test.jpg",
|
||||
* mimeType: "img/jpg",
|
||||
* content: "binary-string",
|
||||
* content: "base64-string",
|
||||
* access: "public"
|
||||
* }
|
||||
* ]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { FileDTO } from "@medusajs/framework/types"
|
||||
import {
|
||||
createWorkflow,
|
||||
WorkflowData,
|
||||
WorkflowResponse,
|
||||
createWorkflow,
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import { uploadFilesStep } from "../steps"
|
||||
|
||||
@@ -27,7 +27,7 @@ export type UploadFilesWorkflowInput = {
|
||||
mimeType: string
|
||||
/**
|
||||
* 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
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ export const uploadFilesWorkflowId = "upload-files"
|
||||
* {
|
||||
* filename: "test.jpg",
|
||||
* mimeType: "img/jpg",
|
||||
* content: "binary-string",
|
||||
* content: "base64-string",
|
||||
* access: "public"
|
||||
* }
|
||||
* ]
|
||||
|
||||
@@ -18,7 +18,7 @@ export interface CreateFileDTO {
|
||||
mimeType: string
|
||||
|
||||
/**
|
||||
* The file content as a binary-encoded string.
|
||||
* The file content as a base64-encoded string.
|
||||
*/
|
||||
content: string
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ export type ProviderUploadFileDTO = {
|
||||
mimeType: string
|
||||
|
||||
/**
|
||||
* The file content as a binary-encoded string
|
||||
* The file content as a base64-encoded string
|
||||
*/
|
||||
content: string
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export interface IFileModuleService extends IModuleService {
|
||||
* const [file] = await fileModuleService.createFiles([{
|
||||
* filename: "product.png",
|
||||
* mimeType: "image/png",
|
||||
* content: "somecontent" // binary string
|
||||
* content: "somecontent" // base64 string
|
||||
* }])
|
||||
*/
|
||||
createFiles(
|
||||
@@ -49,7 +49,7 @@ export interface IFileModuleService extends IModuleService {
|
||||
* const file = await fileModuleService.createFiles({
|
||||
* filename: "product.png",
|
||||
* mimeType: "image/png",
|
||||
* content: "somecontent" // binary string
|
||||
* content: "somecontent" // base64 string
|
||||
* })
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user