mise API - v0.0.0
    Preparing search index...

    Class ChrisIO

    Index
    • Performs a dummy upload for testing purposes.

      Returns Promise<boolean | null>

      A Promise resolving to true on success, or null if client is missing.

    • Deletes one file by its id, without listing anything.

      A file that cannot be LISTED must still be deletable: a folder whose listing the server refuses is exactly the folder an operator most needs to clear, and a delete that resolves its id through the parent's collection cannot help there (#462).

      Parameters

      • fileId: number

        The file's id.

      Returns Promise<Result<boolean>>

      Ok(true) when the file is gone, Err when the server refused.

    • Downloads a file from ChRIS by its ID.

      Parameters

      • fileId: number

        The ID of the file to download.

      Returns Promise<Buffer<ArrayBufferLike> | null>

      A Promise resolving to a Buffer of the file content, or null on failure.

    • Parameters

      • fileId: number

      Returns Promise<Result<{ filename?: string; size?: number; stream: unknown }>>

    • Moves (renames) a file in ChRIS by updating its path.

      Parameters

      • fileId: number

        The file ID.

      • destPath: string

        The target path including filename.

      Returns Promise<Result<boolean>>

      Promise resolving to true on success, false on failure.

    • A file's size as CUBE records it, without reading its bytes.

      Parameters

      • fileId: number

        The file's id.

      Returns Promise<number | null>

      The size in bytes, or null when the file cannot be read or CUBE gives none.

    • Uploads a file to ChRIS.

      Parameters

      • fileBlob: Blob

        The file content as a Blob.

      • uploadDir: string

        The directory path in ChRIS to upload to.

      • filename: string

        The name of the file to create.

      Returns Promise<boolean>

      A Promise resolving to true on success, false on failure.

    • Creates a new folder in ChRIS at the specified path.

      Parameters

      • folderPath: string

        The path where the folder should be created.

      Returns Promise<Result<boolean>>

      A Result containing true if created, false if already exists, or Err on error.

      const result = await chrisIO.folder_create('/uploads/data');
      if (result.ok && result.value) {
      console.log('Folder created successfully');
      }
    • Deletes a folder (and its contents) addressed by path, waiting until the CUBE confirms it is gone.

      Deletion is asynchronous server-side (the DELETE is only accepted), so success is defined as the path no longer resolving within the timeout.

      Parameters

      • path: string

        The folder's CUBE path (leading slash optional).

      • options: { timeoutMs?: number } = {}

        timeoutMs bounds the disappearance poll (default 10s).

      Returns Promise<Result<boolean>>

      Ok(true) when the folder is verifiably gone (or never existed), Err on failure or timeout.

    • Moves (renames) a folder in ChRIS by updating its path.

      Parameters

      • srcPath: string

        The current folder path.

      • destPath: string

        The new folder path.

      Returns Promise<Result<boolean>>

      Promise resolving to true on success, false on failure.

    • Initializes the ChrisIO instance by creating a file browser folder.

      Returns Promise<boolean | null>

      A Promise resolving to true on success, false on failure, or null if client is missing.

    • Uploads a local directory or file to ChRIS recursively.

      Parameters

      • localPath: string

        The path on the local filesystem.

      • remotePath: string

        The destination path on ChRIS. For directories, follows Unix cp semantics: the source directory name is appended to remotePath.

      Returns Promise<boolean>

      Promise success status.