IFClite TypeScript API
    Preparing search index...

    Client for the buildingSMART OpenCDE Documents API 1.0 (https://github.com/buildingSMART/documents-API). Unlike BCF, most of this API is link-driven: only /select-documents, /upload-documents and /document-versions are fixed paths under the base URL — every other operation follows a url the server handed back in a previous response, which is why most methods below take that URL as their argument rather than building one.

    Hierarchy (View Summary)

    Index
    errorLabel: string
    errorNamespace: string | undefined
    fetchFn: FetchLike
    getAccessToken?: BcfTokenProvider
    • POST {upload_cancellation} link off a DocumentToUpload.

      Parameters

      • uploadCancellationUrl: string

      Returns Promise<void>

    • POST {upload_completion} link off a DocumentToUpload, once every part has uploaded.

      Parameters

      • uploadCompletionUrl: string

      Returns Promise<DocumentVersion>

    • GET {document_version_download} link off a DocumentVersion: the file content.

      Parameters

      • documentVersionDownloadUrl: string

      Returns Promise<Blob>

    • GET {document_version_metadata} link off a DocumentVersion.

      Parameters

      • documentVersionMetadataUrl: string

      Returns Promise<DocumentMetadata>

    • GET {document_version} link off a DocumentVersion: that version's own self-URL.

      Parameters

      • documentVersionUrl: string

      Returns Promise<DocumentVersion>

    • GET {document_versions} link off a DocumentVersion: every version of that document.

      Parameters

      • documentVersionsUrl: string

      Returns Promise<DocumentVersions>

    • GET {selectedDocumentsUrl}: the user's selection, once the CDE redirects the client's callback with ?selected_documents_url=... (see parseSelectDocumentsCallback).

      Parameters

      • selectedDocumentsUrl: string

      Returns Promise<SelectedDocuments>

    • POST {uploadDocumentsUrl}: once the CDE redirects the client's callback with ?upload_documents_url=... (see parseUploadDocumentsCallback), send each file's size so the server can plan the multipart split and hand back upload instructions.

      Parameters

      Returns Promise<DocumentsToUpload>

    • POST /document-versions: the latest version of each of documentIds, in one call — meant for periodic polling of a tracked collection. ifNoneMatch, when given the ETag from a previous call, lets the server answer 304 (returned here as null) when nothing changed. The response's own ETag is returned with the result: it is what the NEXT call passes, so dropping it made the polling flow impossible to start (#5438 review).

      Parameters

      • documentIds: string[]
      • OptionalifNoneMatch: string

      Returns Promise<DocumentVersionsPoll | null>

    • Upload one part of a file per its UploadFilePartInstruction. Parts may be uploaded concurrently and in any order; call this once per entry in DocumentToUpload.upload_file_parts, then completeUpload.

      Parameters

      Returns Promise<void>