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
↳
DocsManager
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new DocsManager(apiClient
): DocsManager
Constructs a new instance of BaseManager.
Parameters
Returns
Inherited from
Defined in
Properties
apiClient
• apiClient: JulepApiClient
The JulepApiClient instance used for API interactions.
Inherited from
Defined in
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
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
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
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
Last updated