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
Name | Type | Description |
---|---|---|
| The JulepApiClient instance used for API interactions. |
Returns
Inherited from
Defined in
Properties
apiClient
β’ apiClient: JulepApiClient
The JulepApiClient instance used for API interactions.
Inherited from
Defined in
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
Name | Type |
---|---|
|
|
|
|
| |
|
|
Returns
Promise
<Doc
>
The created document.
Throws
If neither agentId nor userId is provided.
Defined in
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
Name | Type |
---|---|
|
|
|
|
|
|
|
|
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(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
Name | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
Returns
Promise
<CancelablePromise
<{ items?
: Doc
[] }> | CancelablePromise
<{ items?
: Doc
[] }>>
The retrieved documents.
Throws
If neither agentId nor userId is provided.
Defined in
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
Name | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Returns
Promise
<Doc
[]>
The list of filtered documents.
Throws
If neither agentId nor userId is provided.
Defined in
Last updated