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

    Properties

    AuthorizesCaller: boolean

    True when the action authorizes its caller itself, so a public entry point such as the RunAction mutation may run it for an authenticated user without an MJ: Action Authorizations link. Set it only on an action that either checks an authorization the caller must hold, or reads and writes only with the caller's own permissions. Leave it false for an action that acts with more authority than its caller, or that reaches data or sends messages the caller chooses but could not otherwise reach.

    The engine reads the marker only from the class that runs, never from its parent classes. A subclass that overrides a marked action must declare the marker again.

    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