Member Junction
    Preparing search index...

    Creates a new in-progress document and returns a handle for incremental building. The handle is used by subsequent actions (Add Document Content, Preview Document, Modify Document Section, Finalize Document) to build the document piece by piece.

    Parameters:

    • DocumentType (required): 'pdf', 'docx', or 'xlsx'
    • FileName (optional): suggested filename (e.g., 'quarterly-report.docx')
    • Options (optional, JSON): type-specific options (page size, margins, fonts, etc.)

    Output:

    • Handle: UUID for the in-progress document

    Hierarchy

    • BaseFileHandlerAction
      • CreateDocumentAction
    Index

    Constructors

    Methods

    • Get file content from various sources based on parameters Priority: FileID > FileURL > Data parameter

      Parameters

      • params: RunActionParams

        Action parameters

      • dataParamName: string

        Name of the parameter containing direct data

      • fileParamName: string = 'FileID'

        Name of the parameter containing file ID (default: 'FileID')

      • urlParamName: string = 'FileURL'

        Name of the parameter containing file URL (default: 'FileURL')

      Returns Promise<
          {
              content: string
              | Buffer;
              fileName?: string;
              mimeType?: string;
              source: "url" | "storage" | "direct";
          },
      >

      Object with content and metadata

    • Executes the action with the provided parameters.

      Parameters

      Returns Promise<ActionResultSimple>

      Promise resolving to the action result

    • Save file to MJ Storage. Uploads the content to a FileStorageAccount and creates the corresponding MJ: Files entity record.

      Parameters

      • content: string | Buffer

        File content as string or Buffer

      • fileName: string

        Name for the file

      • mimeType: string

        MIME type of the file

      • params: RunActionParams

        Action parameters (for contextUser)

      • OptionalstorageAccountName: string

        Optional: name of the storage account to use (falls back to first active)

      • OptionalstoragePath: string

        Optional: custom storage path prefix (falls back to artifacts/{date}/{uuid}/)

      Returns Promise<string>

      The ID of the newly created MJ: Files record