Doc

@julep/sdk / Modules / managers/doc / DocsManager

Class: DocsManager

managers/doc.DocsManager

BaseManager serves as the base class for all manager classes that interact with the Julep API. It provides common functionality needed for API interactions.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DocsManager(apiClient): DocsManager

Constructs a new instance of BaseManager.

Parameters

Returns

DocsManager

Inherited from

BaseManager.constructor

Defined in

src/managers/base.ts:12

Properties

apiClient

apiClient: JulepApiClient

The JulepApiClient instance used for API interactions.

Inherited from

BaseManager.apiClient

Defined in

src/managers/base.ts:12

Methods

create

create(params): Promise<Doc>

Creates a document based on the provided agentId or userId. Ensures that only one of agentId or userId is provided using xor function. Validates the provided agentId or userId using isValidUuid4.

Parameters

Returns

Promise<Doc>

The created document.

Throws

If neither agentId nor userId is provided.

Defined in

src/managers/doc.ts:133


delete

delete(params): Promise<void>

Deletes a document based on the provided agentId or userId and the specific docId. Ensures that only one of agentId or userId is provided using xor function. Validates the provided agentId or userId using isValidUuid4.

Parameters

Returns

Promise<void>

A promise that resolves when the document is successfully deleted.

Throws

If neither agentId nor userId is provided.

Defined in

src/managers/doc.ts:186


get

get(params): Promise<{ items?: Doc[] }>

Retrieves documents based on the provided agentId or userId. Ensures that only one of agentId or userId is provided using xor function. Validates the provided agentId or userId using isValidUuid4.

Parameters

Returns

Promise<{ items?: Doc[] }>

The retrieved documents.

Throws

If neither agentId nor userId is provided.

Defined in

src/managers/doc.ts:22


list

list(params?): Promise<Doc[]>

Lists documents based on the provided agentId or userId, with optional metadata filtering. Ensures that only one of agentId or userId is provided using xor function. Validates the provided agentId or userId using isValidUuid4. Allows for filtering based on metadata.

Parameters

Returns

Promise<Doc[]>

The list of filtered documents.

Throws

If neither agentId nor userId is provided.

Defined in

src/managers/doc.ts:74

Last updated