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

NameTypeDescription

apiClient

The JulepApiClient instance used for API interactions.

Returns

DocsManager

Inherited from

BaseManager.constructor

Defined in

src/managers/base.ts:14

Properties

apiClient

β€’ apiClient: JulepApiClient

The JulepApiClient instance used for API interactions.

Inherited from

BaseManager.apiClient

Defined in

src/managers/base.ts:14

Methods

create

β–Έ create(options): 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

NameType

options

Object

options.agentId?

string & Format<"uuid">

options.doc

options.userId?

string & Format<"uuid">

Returns

Promise<Doc>

The created document.

Throws

If neither agentId nor userId is provided.

Defined in

src/managers/doc.ts:162


delete

β–Έ delete(options): 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

NameType

options

Object

options.agentId?

string & Format<"uuid">

options.docId

string

options.userId?

string & Format<"uuid">

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:214


get

β–Έ get(options?): Promise<CancelablePromise<{ items?: Doc[] }> | CancelablePromise<{ 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

NameType

options

Object

options.agentId?

string & Format<"uuid">

options.limit?

number & Type<"uint32"> & Minimum<1> & Maximum<1000>

options.offset?

number & Type<"uint32"> & Minimum<0>

options.userId?

string & Format<"uuid">

Returns

Promise<CancelablePromise<{ items?: Doc[] }> | CancelablePromise<{ items?: Doc[] }>>

The retrieved documents.

Throws

If neither agentId nor userId is provided.

Defined in

src/managers/doc.ts:23


list

β–Έ list(options?): 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

NameType

options

Object

options.agentId?

string & Format<"uuid">

options.limit?

number & Type<"uint32"> & Minimum<1> & Maximum<1000>

options.metadataFilter?

Object

options.offset?

number & Type<"uint32"> & Minimum<0>

options.userId?

string & Format<"uuid">

Returns

Promise<Doc[]>

The list of filtered documents.

Throws

If neither agentId nor userId is provided.

Defined in

src/managers/doc.ts:90

Last updated