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.
Methods
extractDataFromDocument
▸ extractDataFromDocument(documentId
, identifier
): Promise
<DocumentTextDataResponse
>
Extracts text data from a document.
Parameters
Name | Type | Description |
---|---|---|
documentId | string | The ID of the document to extract text data from. |
identifier | string | A user-provided identifier (usually a user ID) that is associated with the document. |
Returns
Promise
<DocumentTextDataResponse
>
A promise that resolves with the extracted text data.
getAccessToken
▸ getAccessToken(identifier
): Promise
<PsGetAccessTokenResponse
>
Retrieves an access token for the personal storage service.
Parameters
Name | Type | Description |
---|---|---|
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.
indexDocumentOrFolder
▸ indexDocumentOrFolder(documentOrFolderId
, identifier
, aiIntegrationId
, aiProfileId
, metadata?
): Promise
<void
>
Indexes a document or folder for AI processing.
Parameters
Name | Type | Description |
---|---|---|
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. |
aiIntegrationId | string | The integration ID for the AI processing configuration. |
aiProfileId | string | The profile ID for the AI processing configuration. |
metadata? | AiContextMetadata | Metadata to include with the index |
Returns
Promise
<void
>
A promise that resolves when the document or folder is successfully indexed.
saveAuthCode
▸ saveAuthCode(authCode
, identifier
): Promise
<PsGetAccessTokenResponse
>
Saves an authentication token for the personal storage service.
Parameters
Name | Type | Description |
---|---|---|
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.
unindexDocument
▸ unindexDocument(documentId
, identifier
, aiProfileId
, aiIntegrationId
): Promise
<void
>
Unindexes a previously indexed document, removing it from AI processing.
Parameters
Name | Type | Description |
---|---|---|
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. |
aiProfileId | string | The profile ID for the AI processing configuration. |
aiIntegrationId | string | The integration ID for the AI processing configuration. |
Returns
Promise
<void
>
A promise that resolves when the document is successfully unindexed.