Skip to main content
Generated from the same public contract that feeds the Monaco editor. Declaration-marked deprecated compatibility methods are intentionally excluded. Do not edit this page manually.
This page contains 23 methods. Search the docs for an exact method name, or use this index:

storage.explore()

Lists files and folders from the default explorer namespace.

Overloads

Example

storage.resolveFolderPath()

Resolves an exact active folder path relative to the default explorer root. Notes:
  • Matching is case-insensitive and follows each parent/name segment; this is not a broad term search.
  • Leading and trailing slashes are optional.
  • Missing, archived, deleted, or inaccessible paths fail without creating folders.

Overloads

Example

storage.ensureFolderPath()

Resolves a folder path and idempotently creates any missing segments. Notes:
  • Unavailable with readOnly: true (throws an error).
  • Existing folders are never mutated.
  • ACL options apply to every newly created segment.

Overloads

Example

storage.getFile()

Returns metadata for a file entry. Without an explicit namespace the entry is resolved by its globally unique id, matching the REST Storage API.

Overloads

Example

storage.getFileData()

Reads storage file content. Notes:
  • CSV/TSV, XLSX, NDJSON/JSONL, JSON arrays, and XML return structured pages with rows, headers, columns, and a cursor. Detection uses MIME or the supported file extension; XML requires recordPath.
  • mode: “lines” returns physical string lines, including headers and the final empty line; encoding and separator are detected or overridden.
  • CSV dialect options include encoding, delimiter, recordDelimiter, headerRow, quote and escape. quote: false keeps quotes/backslashes literal and ignores escape.
  • maxRecordBytes defaults to 64 MiB per logical CSV record, independently of page/callback sizes. Oversized or malformed records reject indexing with STORAGE_CSV_INVALID before rows are returned. Wrong-width records also reject by default; onError: “skipRow” skips them with csvReport diagnostics.
  • CSV errors include errorCount, at most 100 safe location diagnostics and diagnosticsTruncated; no raw row/cell values. Physical counters are distinct from logical rowCount.
  • Other text file batch reads reuse cached line stats and auto-build them if missing.
  • Binary reads return a base64 string.
  • Direct binary reads are limited to 10 MiB unless you request a ranged buffer.

Overloads

Example

storage.walkFileData()

Streams structured records from CSV/TSV, XLSX, NDJSON/JSONL, JSON arrays, or record-oriented XML into awaited callbacks. Plain text, top-level JSON objects, and binary files are not supported in record mode. mode: “lines” supports physical text lines without parsing CSV fields. Omitted take scans all rows. XLSX uses the first visible sheet by default; XML requires recordPath. Defaults: batchSize=2000, readBatchSize=100000; both accept 1–100,000. Source changes or callback errors stop the scan. Invalid CSV syntax rejects indexing with STORAGE_CSV_INVALID before the first business callback; diagnostics contain no raw data. Keep only aggregates.

Overloads

Example

storage.getFileStats()

Builds reusable record or worksheet indexes and returns file statistics. Notes:
  • mode: “lines” builds a separate physical-line index with lineCount, map, batches, encoding and separator.
  • CSV stats include physicalLineCount, blankLineCount and endsWithRecordDelimiter independently of logical rowCount.
  • CSV dialect options include encoding, delimiter, recordDelimiter, headerRow, quote and escape. quote: false disables quoting and ignores escape.
  • maxRecordBytes defaults to 64 MiB per logical record, independently of batch size. Invalid syntax or oversized records reject indexing with STORAGE_CSV_INVALID. Wrong source field counts reject by default; onError: “skipRow” skips them with csvReport diagnostics.
  • The error contains errorCount, at most 100 location diagnostics and diagnosticsTruncated, never raw rows/cells; RecordTooLarge may report only the inspected prefix.
  • physicalLineCount counts actual lines including headers, blank lines and multiline fields. Legacy lineCount retains the synthetic terminal empty line when present.
  • Derived stats are cached on the storage entry metadata for later batch reads.

Overloads

Example

storage.getEntry()

Returns metadata for any storage entry. Without an explicit namespace the entry is resolved by its globally unique id, matching the REST Storage API.

Overloads

Example

storage.createFolder()

Creates a folder in the default explorer namespace. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.putObject()

Uploads a small object in one request in the default explorer namespace. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.createUploadSession()

Opens an upload session for a file in the default explorer namespace. Notes:
  • Unavailable with readOnly: true (throws an error).
  • A session is a temporary, durable upload control record. It reserves the intended file name and destination, stores upload policy, ACL, retention, schema, and progress, but it is not a readable Storage file. The durable entry exists only after the session reaches FINALIZED.
  • uploadMode controls how bytes arrive. direct returns a temporary upload target for the complete file. chunked accepts caller-numbered parts. incremental assigns part numbers by default and also accepts an explicit number for repair. writeMode is independent: it controls only CSV/XLSX row materialization (staged or declared-schema direct).
  • Use this instead of storage.appendFile(...). Managed direct uploads are finalized automatically after Storage confirms the transfer; observe the session until FINALIZED and do not call finalizeUploadSession for that path. Explicitly finalize chunked and incremental sessions.
  • Structured CSV/TSV and XLSX sessions default to computeStats: 'sync' so byte maps, row indexes, and file stats are ready after finalize. Text text/* upload sessions also default to sync; other binary sessions default to none. An explicit compute mode always overrides the default. The staged XLSX path may still persist its reusable index when none is explicit; structured direct with none skips it. Both default to writeMode: 'staged'.
  • XLSX, CSV, and TSV share schemaPolicy: { profile?, additionalProperties? } plus sheets[].table.columns[]. CSV/TSV has one logical sheet. Column types are string, number, boolean, date, and object; object parses only a JSON object or array. The default fallback policy leaves an incompatible whole column as strings and records diagnostics without replacing cells with null. profile: 'strict' fails indexing on missing columns, invalid values, or sheet mismatches. additionalProperties independently controls extra source columns: allow retains, strip omits from structured rows, and reject fails indexing. The default is fallback + allow; strict defaults to reject. Use strict + strip when extra columns may appear but the declared layout and value types must match. The raw file remains available.
  • Set restricted: true with explicit users and/or groups to define the finalized entry ACL. These relations may be changed later with storage.updateEntry(...); restricted: false clears them. Use writeMode: 'direct' for configured CSV/XLSX row exports with a declared schema. For XLSX, declare every worksheet with a non-empty table.columns before appending; direct XLSX parts are row-only and cannot contain cells. Use the default staged mode when append requests can be retried, replaced, reordered, or need inferred columns, sparse cells, formulas, or dynamic worksheets. A single sheets part can append rows to multiple declared worksheets. Staged mode is the durable default for independent requests that may be retried, replaced, reordered, or use inferred columns, sparse cells, formulas, or dynamic worksheets.

Overloads

Examples

direct upload

declared-schema XLSX

server-mediated row parts

storage.extendUploadSession()

Extends the TTL for an active upload session. Notes:
  • Unavailable with readOnly: true (throws an error).
  • uploadPart renews the durable session lease automatically; call this only across idle gaps.

Overloads

Example

storage.getUploadSession()

Returns the current upload session state together with uploaded part manifests. Notes:
  • Available with readOnly: true because it only reads session state.
  • Multipart sessions expose uploaded parts with computed byte ranges.

Overloads

Example

storage.uploadPart()

Uploads one part into an active multipart upload session. Notes:
  • Unavailable with readOnly: true (throws an error).
  • Renews the durable session lease before processing and after committing the part.
  • Accepted part manifests remain durable across worker restarts.

Overloads

Examples

incremental numbering

repair a specific multipart chunk

storage.finalizeUploadSession()

Finalizes a chunked or incremental upload session and materializes the Storage entry. Managed direct uploads finalize automatically and should be observed with getUploadSession() instead of calling this method. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.abortUploadSession()

Cancels an active upload session. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.updateEntry()

Updates mutable storage entry fields such as name, metadata, or ACLs. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.moveEntry()

Moves an entry to another folder or registered Storage root. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.archiveEntry()

Archives an entry without deleting its backing object. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.restoreEntry()

Restores an archived storage entry. Permanently deleted entries cannot be restored. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.deleteEntry()

Permanently deletes an archived storage entry and its backing objects. Use archiveEntry for reversible removal and restoreEntry to undo an archive. Notes:
  • Unavailable with readOnly: true (throws an error).

Overloads

Example

storage.getDownload()

Generates a signed download URL for a storage file. Without an explicit namespace the entry is resolved by its globally unique id, matching REST. Optional ttlSeconds accepts integer seconds from 1 to 604800 (seven days). Omit it to retain the configured default; file retention can shorten the TTL.

Overloads

Example

storage.getDocument()

Reads bounded text, JSON, XML, or PDF/DOCX text from Storage. PDF/DOCX extraction is text-only, capped at 40,000 characters and 100 PDF pages, with explicit extraction/truncation and possible-OCR metadata. Source input is limited to 10 MiB; use getFileData for XLSX or record-oriented files. format: 'text' is the default and supports optional byte ranges. For text line windows pass startLine/endLine/maxChars; the result contains line metadata instead of byte offsets. Do not mix line and byte ranges. format: 'json' returns document from JSON.parse; format: 'xml' returns an order-preserving XML representation. format: 'auto' selects JSON/XML from the stored MIME type or file extension.

Overloads

Example

Last modified on October 14, 2026