@twinfinity/core
    Preparing search index...

    Interface ITwinClient

    interface ITwinClient {
        baseUrl: string;
        batchAssets(
            twinId: string,
            operations: AssetBatchOperation[],
            signal?: AbortSignal,
        ): Promise<AssetBatchResponse>;
        batchGetAssets(
            twinId: string,
            ids: string[],
            signal?: AbortSignal,
        ): Promise<AssetBatchGetResponse>;
        createAssetAttachmentUploadSession(
            twinId: string,
            assetId: string,
            attachmentId: string,
            body: AttachmentPost,
            signal?: AbortSignal,
        ): Promise<ApiCreateUploadSessionResponse>;
        createAssets(
            twinId: string,
            assets: AssetPost[],
            signal?: AbortSignal,
        ): Promise<AssetGet[]>;
        createOrUpdateTwin(
            twinId: string,
            twin: TwinPut,
            signal?: AbortSignal,
        ): Promise<TwinGet>;
        createOrUpdateTwinFile(
            twinId: string,
            fileId: string,
            twinFile: TwinFilePut,
            signal?: AbortSignal,
        ): Promise<TwinFileGet>;
        deleteAsset(
            twinId: string,
            assetId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<AssetGet>;
        deleteAssetAttachment(
            twinId: string,
            assetId: string,
            attachmentId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<AttachmentGet>;
        deleteAssetCategory(
            categoryId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<AssetCategoryGet>;
        deleteAssetType(
            categoryId: string,
            typeId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<AssetTypeGet>;
        deleteTwin(
            twinId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<TwinGet>;
        deleteTwinFile(
            twinId: string,
            fileId: string,
            deleteRequest: TwinFileDelete,
            signal?: AbortSignal,
        ): Promise<TwinFileGet>;
        downloadTwinContent(
            twinId: string,
            twinVersion: number,
            content: TwinContentResponse,
            signal?: AbortSignal,
        ): Promise<ArrayBuffer>;
        getAsset(
            twinId: string,
            assetId: string,
            signal?: AbortSignal,
        ): Promise<AssetGet>;
        getAssetAttachmentBlob(
            twinId: string,
            assetId: string,
            attachmentId: string,
            signal?: AbortSignal,
        ): Promise<Response>;
        getAssetAttachmentUploadStatus(
            twinId: string,
            assetId: string,
            token: string,
            signal?: AbortSignal,
        ): Promise<UploadStatusGet>;
        getAssetCategory(
            categoryId: string,
            signal?: AbortSignal,
        ): Promise<AssetCategoryGet>;
        getAssetType(
            categoryId: string,
            typeId: string,
            signal?: AbortSignal,
        ): Promise<AssetTypeGet>;
        getAssetTypeCatalog(signal?: AbortSignal): Promise<AssetCatalogResponse>;
        getAssetTypeMetaSchema(
            signal?: AbortSignal,
        ): Promise<Record<string, unknown>>;
        getMyPermissions(signal?: AbortSignal): Promise<MyPermissions>;
        getProcessorEvents(
            twinId: string,
            twinVersion: number,
            processorId: string,
            offset?: number,
            limit?: number,
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<TwinProcessorEvent>>;
        getTwin(
            twin: string | { id: string; version: number },
            signal?: AbortSignal,
        ): Promise<TwinGet>;
        getTwinContent(
            twinId: string,
            signal?: AbortSignal,
        ): Promise<TwinVersionContentResponse>;
        getTwinDiagnostics(
            twinId: string,
            signal?: AbortSignal,
        ): Promise<TwinDiagnosticsResponse>;
        getTwinFile(
            twinId: string,
            fileId: string,
            signal?: AbortSignal,
        ): Promise<TwinFileGet>;
        getTwinFileContent(
            twinId: string,
            fileId: string,
            signal?: AbortSignal,
        ): Promise<Blob>;
        getTwinFileVersion(
            twinId: string,
            fileId: string,
            version: number,
            signal?: AbortSignal,
        ): Promise<TwinFileGet>;
        getTwinFileVersionContent(
            twinId: string,
            fileId: string,
            version: number,
            signal?: AbortSignal,
        ): Promise<Blob>;
        getTwinVersionContent(
            twinId: string,
            twinVersion: number,
            signal?: AbortSignal,
        ): Promise<TwinVersionContentResponse>;
        getTwinVersionDiagnostics(
            twinId: string,
            twinVersion: number,
            signal?: AbortSignal,
        ): Promise<TwinDiagnosticsResponse>;
        getTwinVersionEvents(
            twinId: string,
            twinVersion: number,
            offset?: number,
            limit?: number,
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<TwinProcessorEvent>>;
        listAllTwins(
            relatedTo?: string,
            signal?: AbortSignal,
        ): Promise<ListTwinItem[]>;
        listAssetAttachments(
            twinId: string,
            assetId: string,
            options?: {
                includeDeleted?: boolean;
                limit?: number;
                offset?: number;
                page?: string;
            },
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<AttachmentGet>>;
        listAssetCategories(
            options?: { includeDeleted?: boolean; limit?: number; page?: string },
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<AssetCategoryGet>>;
        listAssetCategoryVersions(
            categoryId: string,
            options?: { includeDeleted?: boolean; limit?: number; page?: string },
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<AssetCategoryGet>>;
        listAssets(
            twinId: string,
            offset?: number,
            limit?: number,
            options?: { includeDeleted?: boolean },
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<AssetListItem>>;
        listAssetTypes(
            categoryId: string,
            options?: { includeDeleted?: boolean; limit?: number; page?: string },
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<AssetTypeGet>>;
        listAssetTypeVersions(
            categoryId: string,
            typeId: string,
            options?: { includeDeleted?: boolean; limit?: number; page?: string },
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<AssetTypeGet>>;
        listTwinFiles(
            twinId: string,
            options?: TwinFileListOptions,
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<TwinFileGet>>;
        listTwinFileVersions(
            twinId: string,
            fileId: string,
            options?: TwinFileVersionListOptions,
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<TwinFileGet>>;
        listTwins(
            relatedTo?: string,
            page?: string,
            limit?: number,
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<ListTwinItem>>;
        listTwinVersions(
            id: string,
            options?: { includeDeleted?: boolean; limit?: number; page?: string },
            signal?: AbortSignal,
        ): Promise<PaginatedResponse<ListTwinItem>>;
        loadGeometryInfo(
            twin: string | { id: string; version: number },
            signal?: AbortSignal,
        ): Promise<TwinGeometryInfo<T8GIMeshDescriptor, T8GIStyle, T8GIRegion>>;
        loadGeometryInfoWithFactories<TMeshDescriptor, TStyle, TRegion>(
            twin: string | { id: string; version: number },
            meshDescriptorFactory: (dto: T8GIMeshDescriptorDTO) => TMeshDescriptor,
            styleFactory: (dto: T8GIStyleDTO) => TStyle,
            regionFactory: (dto: T8GIRegionDTO) => TRegion,
            signal?: AbortSignal,
        ): Promise<TwinGeometryInfo<TMeshDescriptor, TStyle, TRegion>>;
        loadTwin(
            twin: string | { id: string; version: number },
            signal?: AbortSignal,
        ): Promise<
            Twin<
                T8Project<T8Product<T8EntityType<T8Unit>, T8Unit>, T8Unit>,
                T8Product<T8EntityType<T8Unit>, T8Unit>,
                T8EntityType<T8Unit>,
                T8Unit,
            >,
        >;
        loadTwinWithFactories<TProject, TProduct, TEntityType, TUnit>(
            twin: string | { id: string; version: number },
            projectFactory: (dto: T8ClientProjectDTO<TUnit>) => TProject,
            productFactory: (dto: T8ClientProductDTO<TUnit>) => TProduct,
            entityTypeFactory: (dto: T8ClientEntityTypeDTO<TUnit>) => TEntityType,
            unitFactory: (dto: T8ClientUnitDTO, dataModel: T8ClientModelDTO) => TUnit,
            connectProject: (
                dto: T8ClientProjectConnectionsDTO<TProduct>,
                project: TProject,
            ) => void,
            connectProduct: (
                dto: T8ClientProductConnectionsDTO<TProduct, TEntityType>,
                product: TProduct,
            ) => void,
            signal?: AbortSignal,
        ): Promise<Twin<TProject, TProduct, TEntityType, TUnit>>;
        loadTwinWithGeometry(
            twin: string | { id: string; version: number },
            signal?: AbortSignal,
        ): Promise<
            Twin<
                T8ProjectWithGeometry,
                T8ProductWithGeometry<T8EntityType<T8Unit>>,
                T8EntityType<T8Unit>,
                T8Unit,
            >,
        >;
        putAssetAttachment(
            twinId: string,
            assetId: string,
            attachmentId: string,
            body: AssetAttachmentPut,
            signal?: AbortSignal,
        ): Promise<AttachmentGet>;
        putAssetCategory(
            categoryId: string,
            body: AssetCategoryPut,
            signal?: AbortSignal,
        ): Promise<AssetCategoryGet>;
        putAssetType(
            categoryId: string,
            typeId: string,
            body: AssetTypePut,
            signal?: AbortSignal,
        ): Promise<AssetTypeGet>;
        restoreAsset(
            twinId: string,
            assetId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<AssetGet>;
        restoreAssetAttachment(
            twinId: string,
            assetId: string,
            attachmentId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<AttachmentGet>;
        restoreAssetCategory(
            categoryId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<AssetCategoryGet>;
        restoreAssetType(
            categoryId: string,
            typeId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<AssetTypeGet>;
        restoreTwin(
            twinId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<TwinGet>;
        restoreTwinFile(
            twinId: string,
            fileId: string,
            etag: string,
            signal?: AbortSignal,
        ): Promise<TwinFileGet>;
        updateAsset(
            twinId: string,
            assetId: string,
            asset: AssetPut,
            signal?: AbortSignal,
        ): Promise<AssetGet>;
        updateTwin(
            twinId: string,
            twin: TwinPut,
            signal?: AbortSignal,
        ): Promise<TwinGet>;
        uploadAssetAttachmentFile(
            session: ApiCreateUploadSessionResponse,
            file: Blob,
            signal?: AbortSignal,
        ): Promise<{ token: string }>;
    }

    Implemented by

    Index

    Properties

    baseUrl: string

    Rooted twins base URL — typically <host>/sites/<container>/_ps/twins. Use this when constructing related URLs (e.g. twin content) that need to live in the same auth scope as the metadata calls.

    Methods

    • Executes a batch of asset operations (upsert, delete, restore) atomically. All operations succeed or all are rolled back.

      Parameters

      • twinId: string
      • operations: AssetBatchOperation[]

        Array of batch operations (max 1000).

      • Optionalsignal: AbortSignal

      Returns Promise<AssetBatchResponse>

      On validation failure (400).

      On insufficient permissions (403).

      On conflict (409) or not found (404). The error's response has per-item results with reverted statuses.

    • Retrieves multiple assets by ID in a single request.

      Parameters

      • twinId: string
      • ids: string[]

        Array of asset IDs (max 1000).

      • Optionalsignal: AbortSignal

      Returns Promise<AssetBatchGetResponse>

      On validation failure (400).

    • Parameters

      • twinId: string
      • assets: AssetPost[]
      • Optionalsignal: AbortSignal

      Returns Promise<AssetGet[]>

      On invalid request body (400). The error's errorBody has structured detail.

    • Creates a new twin or updates an existing one (upsert). Provide etag in the twin body to update.

      Parameters

      • twinId: string
      • twin: TwinPut
      • Optionalsignal: AbortSignal

      Returns Promise<TwinGet>

      On invalid request body (400).

      On etag mismatch (409). The error's currentTwin contains the server's current state.

    • Parameters

      • twinId: string
      • fileId: string
      • twinFile: TwinFilePut
      • Optionalsignal: AbortSignal

      Returns Promise<TwinFileGet>

      On invalid request body (400).

      On etag mismatch (409). The error's currentTwinFile contains the server's current state.

    • Parameters

      • twinId: string
      • assetId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetGet>

      When the asset does not exist (404).

      On etag mismatch (409). The error's currentAsset contains the server's current state.

    • Soft-deletes an attachment.

      Parameters

      • twinId: string
      • assetId: string
      • attachmentId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<AttachmentGet>

      On etag mismatch (409).

      When the attachment does not exist (404).

    • Soft-deletes a category. Inserts a new asset_category_versions row with is_deleted=true; the previous version is retained as an audit trail.

      Parameters

      • categoryId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetCategoryGet>

      When the category does not exist (404).

      On etag mismatch (409).

    • Soft-deletes a type. Inserts a new asset_type_versions row with is_deleted=true; the previous version is retained as an audit trail.

      Parameters

      • categoryId: string
      • typeId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetTypeGet>

      When the type does not exist (404).

      On etag mismatch (409).

    • Parameters

      • twinId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<TwinGet>

      When the twin does not exist (404).

      On etag mismatch (409). The error's currentTwin contains the server's current state.

    • Parameters

      • twinId: string
      • fileId: string
      • deleteRequest: TwinFileDelete
      • Optionalsignal: AbortSignal

      Returns Promise<TwinFileGet>

      When the file does not exist (404).

      On etag mismatch (409). The error's currentTwinFile contains the server's current state.

      On invalid request (400).

    • Parameters

      Returns Promise<ArrayBuffer>

    • Parameters

      • twinId: string
      • assetId: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetGet>

      When the asset does not exist (404).

    • Downloads an attachment's blob as a Response. The caller decides whether to consume it as text, ArrayBuffer, or Blob.

      Parameters

      • twinId: string
      • assetId: string
      • attachmentId: string
      • Optionalsignal: AbortSignal

      Returns Promise<Response>

      When the attachment does not exist (404).

    • Polls the in-memory upload-session cache for an attachment that's being uploaded.

      Parameters

      • twinId: string
      • assetId: string
      • token: string
      • Optionalsignal: AbortSignal

      Returns Promise<UploadStatusGet>

    • Parameters

      • categoryId: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetCategoryGet>

      When the category does not exist (404).

    • Parameters

      • categoryId: string
      • typeId: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetTypeGet>

      When the category or type does not exist (404).

    • Returns the customer's asset-type catalog: categories nested with their latest non-deleted types and full metadata schemas inline. One round-trip is enough to populate a picker dropdown and render any per-type metadata form.

      Parameters

      • Optionalsignal: AbortSignal

      Returns Promise<AssetCatalogResponse>

    • Returns the Twinfinity meta-schema document — the JSON Schema describing valid asset-type metadata schemas. The bytes the backend itself validates against, served verbatim. Power-user tools (Monaco-backed JSON editors, schema-aware tooling) fetch this at runtime so their in-editor diagnostics line up with what the server will accept, decoupled from the FE bundle's build time.

      Parameters

      • Optionalsignal: AbortSignal

      Returns Promise<Record<string, unknown>>

    • Returns the caller's named, customer-scoped capabilities against the Twin service (e.g. ViewAssetTypes, EditAssetTypes). The admin app uses this to enable or disable buttons instead of letting the user click through to a 403.

      No client-side cache — every call hits the wire. Underlying scope grants don't shift within a session, so callers are expected to memoise the result themselves (e.g. via React Query / a once-on-mount fetch) rather than calling this on every render.

      Throws TwinUnauthenticatedError on 401 (no valid auth context; caller should redirect to login). Returns an empty permissions array on 403 (authenticated but no Twin-service capabilities). Unknown capability strings should be ignored — adding a new capability is a non-breaking change.

      Parameters

      • Optionalsignal: AbortSignal

      Returns Promise<MyPermissions>

    • Parameters

      • twinId: string
      • twinVersion: number
      • processorId: string
      • Optionaloffset: number
      • Optionallimit: number
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<TwinProcessorEvent>>

      On invalid query parameters (400).

      When the processor does not exist for this twin version (404).

    • Parameters

      • twin: string | { id: string; version: number }

        Twin ID string, or {id, version} to fetch a specific version.

      • Optionalsignal: AbortSignal

      Returns Promise<TwinGet>

      When the twin or version does not exist (404).

    • Returns content for the latest twin version.

      Parameters

      • twinId: string
      • Optionalsignal: AbortSignal

      Returns Promise<TwinVersionContentResponse>

      When the twin does not exist (404).

    • Parameters

      • twinId: string
      • Optionalsignal: AbortSignal

      Returns Promise<TwinDiagnosticsResponse>

      When the twin does not exist (404).

    • Parameters

      • twinId: string
      • fileId: string
      • Optionalsignal: AbortSignal

      Returns Promise<TwinFileGet>

      When the file does not exist (404).

      On invalid request (400).

    • Parameters

      • twinId: string
      • fileId: string
      • Optionalsignal: AbortSignal

      Returns Promise<Blob>

      When the file does not exist (404).

    • Parameters

      • twinId: string
      • fileId: string
      • version: number
      • Optionalsignal: AbortSignal

      Returns Promise<TwinFileGet>

      When the file or version does not exist (404).

    • Parameters

      • twinId: string
      • fileId: string
      • version: number
      • Optionalsignal: AbortSignal

      Returns Promise<Blob>

      When the file or version does not exist (404).

    • Parameters

      • twinId: string
      • twinVersion: number
      • Optionalsignal: AbortSignal

      Returns Promise<TwinVersionContentResponse>

      When the twin or version does not exist (404).

    • Parameters

      • twinId: string
      • twinVersion: number
      • Optionalsignal: AbortSignal

      Returns Promise<TwinDiagnosticsResponse>

      When the twin or version does not exist (404).

    • Parameters

      • twinId: string
      • twinVersion: number
      • Optionaloffset: number
      • Optionallimit: number
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<TwinProcessorEvent>>

      On invalid query parameters (400).

      When the twin or version does not exist (404).

    • Fetches all twins by auto-paginating through listTwins. Caps at 1000 pages.

      Parameters

      • OptionalrelatedTo: string

        Filter twins by container ID.

      • Optionalsignal: AbortSignal

      Returns Promise<ListTwinItem[]>

    • Lists attachments for a single asset.

      Parameters

      • twinId: string
      • assetId: string
      • Optionaloptions: { includeDeleted?: boolean; limit?: number; offset?: number; page?: string }
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<AttachmentGet>>

    • Parameters

      • Optionaloptions: { includeDeleted?: boolean; limit?: number; page?: string }
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<AssetCategoryGet>>

      On invalid query parameters (400).

    • Returns every version of a single asset category, newest first. Mirrors listAssetTypeVersions and twin.get_twin_versions.

      Parameters

      • categoryId: string
      • Optionaloptions: { includeDeleted?: boolean; limit?: number; page?: string }
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<AssetCategoryGet>>

      When the category's header row does not exist (404).

    • Parameters

      • twinId: string
      • Optionaloffset: number
      • Optionallimit: number
      • Optionaloptions: { includeDeleted?: boolean }
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<AssetListItem>>

      On invalid query parameters (400).

      When the twin does not exist (404).

    • Parameters

      • categoryId: string
      • Optionaloptions: { includeDeleted?: boolean; limit?: number; page?: string }
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<AssetTypeGet>>

      On invalid query parameters (400).

    • Returns every version of a single asset type, newest first. Mirrors twin.get_twin_versions.

      Parameters

      • categoryId: string
      • typeId: string
      • Optionaloptions: { includeDeleted?: boolean; limit?: number; page?: string }
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<AssetTypeGet>>

      When the type's header row does not exist (404).

    • Parameters

      • OptionalrelatedTo: string

        Filter twins by container ID.

      • Optionalpage: string
      • Optionallimit: number
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<ListTwinItem>>

      On invalid query parameters (400).

    • Parameters

      • id: string
      • Optionaloptions: { includeDeleted?: boolean; limit?: number; page?: string }
      • Optionalsignal: AbortSignal

      Returns Promise<PaginatedResponse<ListTwinItem>>

      On invalid query parameters (400).

    • Downloads and deserializes geometry info (t8gi) using default types. When no version is specified, searches versions newest-first for one containing t8gi content.

      Parameters

      • twin: string | { id: string; version: number }

        Twin ID string, or {id, version} to load a specific version.

      • Optionalsignal: AbortSignal

      Returns Promise<TwinGeometryInfo<T8GIMeshDescriptor, T8GIStyle, T8GIRegion>>

      When no version has t8gi content.

    • Downloads and deserializes both the client model (t8cm) and geometry (t8gi/t8gd) into a combined result. When no version is specified, searches versions newest-first for one containing both t8cm and t8gi content.

      Parameters

      • twin: string | { id: string; version: number }

        Twin ID string, or {id, version} to load a specific version.

      • Optionalsignal: AbortSignal

      Returns Promise<
          Twin<
              T8ProjectWithGeometry,
              T8ProductWithGeometry<T8EntityType<T8Unit>>,
              T8EntityType<T8Unit>,
              T8Unit,
          >,
      >

      When no version has both t8cm and t8gi content.

    • Updates an attachment's description / soft-delete flag. documentId is immutable — rebinding is rejected.

      Parameters

      • twinId: string
      • assetId: string
      • attachmentId: string
      • body: AssetAttachmentPut
      • Optionalsignal: AbortSignal

      Returns Promise<AttachmentGet>

      On etag mismatch (409). The error's currentAttachment carries the server's current state.

      When the attachment does not exist (404).

    • Upserts an asset category. Provide an empty/missing etag for first writes and the existing etag to update.

      Parameters

      Returns Promise<AssetCategoryGet>

      On invalid request body (400).

      On etag mismatch (409). The error's currentCategory contains the server's current state.

    • Upserts an asset type. The metadata schema is validated against the Twinfinity meta-schema at the API boundary; invalid schemas surface as a 400 with cause: MetadataSchemaInvalid.

      Parameters

      • categoryId: string
      • typeId: string
      • body: AssetTypePut
      • Optionalsignal: AbortSignal

      Returns Promise<AssetTypeGet>

      On invalid request body (400). The error's errorBody carries the structured cause.

      On etag mismatch (409). The error's currentType contains the server's current state.

    • Parameters

      • twinId: string
      • assetId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetGet>

      When the asset does not exist (404).

      On etag mismatch (409). The error's currentAsset contains the server's current state.

    • Restores a soft-deleted attachment.

      Parameters

      • twinId: string
      • assetId: string
      • attachmentId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<AttachmentGet>

      On etag mismatch (409).

      When the attachment does not exist (404).

    • Restores a soft-deleted category. Inserts a new asset_category_versions row with is_deleted=false; mirrors twin restore.

      Parameters

      • categoryId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetCategoryGet>

      When the category does not exist (404).

      On etag mismatch (409).

    • Restores a soft-deleted type. Inserts a new asset_type_versions row with is_deleted=false; mirrors twin restore.

      Parameters

      • categoryId: string
      • typeId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<AssetTypeGet>

      When the type does not exist (404).

      On etag mismatch (409).

    • Parameters

      • twinId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<TwinGet>

      When the twin does not exist (404).

      On etag mismatch (409). The error's currentTwin contains the server's current state.

    • Parameters

      • twinId: string
      • fileId: string
      • etag: string
      • Optionalsignal: AbortSignal

      Returns Promise<TwinFileGet>

      When the file does not exist (404).

      On etag mismatch (409). The error's currentTwinFile contains the server's current state.

      On invalid request (400).

    • Parameters

      • twinId: string
      • assetId: string
      • asset: AssetPut
      • Optionalsignal: AbortSignal

      Returns Promise<AssetGet>

      On invalid request body (400). The error's errorBody has structured detail.

      On etag mismatch (409). The error's currentAsset contains the server's current state.