@squidcloud/client
    Preparing search index...

    Class PersonalStorageClient

    Client to handle personal storage integrations such as Google Drive or Microsoft OneDrive. Provides methods for saving authentication tokens, indexing documents or folders for AI processing, and unindexing documents from AI processing.

    Index

    Methods

    • Retrieves an access token for the personal storage service.

      Parameters

      • identifier: string

        A user-provided identifier (usually a user ID) that is associated with the token.

      Returns Promise<PsGetAccessTokenResponse>

      A promise that resolves with the access token and expiration time.

    • Indexes a document or folder for AI processing.

      Parameters

      • documentOrFolderId: string

        The ID of the document or folder to be indexed.

      • identifier: string

        A user-provided identifier (usually a user ID) that will be associated with the document.

      • agentId: string

        The agent ID for the AI processing configuration.

      • Optionalmetadata: AiContextMetadata

        Metadata to include with the index

      Returns Promise<void>

      A promise that resolves when the document or folder is successfully indexed.

    • Lists all documents or folders that have been indexed for AI processing.

      Parameters

      • identifier: string

        A user-provided identifier (usually a user ID) associated with the indexed documents.

      • agentId: string

        The AI agent ID used when indexing the documents.

      • Optionaltype: PsDocumentType

        (Optional) The type of items to list: 'file' or 'folder'. If omitted, returns both.

      Returns Promise<PsIndexedDocument[]>

      A promise that resolves with an array of indexed documents or folders.

    • Saves an authentication token for the personal storage service.

      Parameters

      • authCode: string

        The authorization code obtained from the OAuth flow for the personal storage service.

      • identifier: string

        A user-provided identifier (usually a user ID) that will be associated with the token.

      Returns Promise<PsGetAccessTokenResponse>

      A promise that resolves with the access token and expiration time.

    • Unindexes a previously indexed document, removing it from AI processing.

      Parameters

      • documentId: string

        The ID of the document to be unindexed.

      • identifier: string

        A user-provided identifier (usually a user ID) that was associated with the document.

      • agentId: string

        The agent ID for the AI processing configuration.

      Returns Promise<void>

      A promise that resolves when the document is successfully unindexed.