- LiteGraphSdk ⇐
SdkBase LiteGraph SDK class. Extends the SdkBase class.
- SdkBase
SDK Base class for making API calls with logging and timeout functionality.
LiteGraph SDK class. Extends the SdkBase class.
Extends: SdkBase
- LiteGraphSdk ⇐
SdkBase- module.exports ⏏
- new module.exports(endpoint, [tenantGuid], [accessKey])
- .graphExists(guid, [cancellationToken]) ⇒
Promise.<boolean> - .createGraph(graph, [cancellationToken]) ⇒
Promise.<Graph> - .readGraphs([cancellationToken]) ⇒
Promise.<Array.<Graph>> - .searchGraphs(searchReq, [cancellationToken]) ⇒
Promise.<SearchResult> - .readGraph(guid, [cancellationToken]) ⇒
Promise.<Graph> - .updateGraph(graph, [cancellationToken]) ⇒
Promise.<Graph> - .deleteGraph(guid, [cancellationToken], force)
- .exportGraphToGexf(guid, [cancellationToken]) ⇒
Promise.<string> - .batchExistence(graphGuid, existenceRequest, [cancellationToken]) ⇒
Promise.<Object> - .nodeExists(graphGuid, guid, [cancellationToken]) ⇒
Promise.<boolean> - .createNodes(graphGuid, nodes, [cancellationToken]) ⇒
Promise.<Array.<Node>> - .createNode(node, [cancellationToken]) ⇒
Promise.<Node> - .readNodes(graphGuid, [cancellationToken]) ⇒
Promise.<Array.<Node>> - .searchNodes(searchReq, graphGuid, [cancellationToken]) ⇒
Promise.<SearchResult> - .readNode(graphGuid, nodeGuid, [cancellationToken]) ⇒
Promise.<Node> - .updateNode(node, [cancellationToken]) ⇒
Promise.<Node> - .deleteNode(graphGuid, nodeGuid, [cancellationToken])
- .deleteNodes(graphGuid, [cancellationToken])
- .deleteMultipleNodes(graphGuid, nodeGuids, [cancellationToken])
- .edgeExists(graphGuid, guid, [cancellationToken]) ⇒
Promise.<boolean> - .createEdges(graphGuid, edges, [cancellationToken]) ⇒
Promise.<Array.<Object>> - .createEdge(edge, [cancellationToken]) ⇒
Promise.<Edge> - .readEdges(graphGuid, [cancellationToken]) ⇒
Promise.<Array.<Edge>> - .searchEdges(graphGuid, searchReq, [cancellationToken]) ⇒
Promise.<SearchResult> - .readEdge(graphGuid, edgeGuid, [cancellationToken]) ⇒
Promise.<Edge> - .updateEdge(edge, [cancellationToken]) ⇒
Promise.<Edge> - .deleteEdge(graphGuid, edgeGuid, [cancellationToken]) ⇒
Promise.<void> - .deleteEdges(graphGuid, [cancellationToken])
- .deleteMultipleEdges(graphGuid, edgeGuids, [cancellationToken])
- .getEdgesFromNode(graphGuid, nodeGuid, [cancellationToken]) ⇒
Promise.<Array.<Edge>> - .getEdgesToNode(graphGuid, nodeGuid, [cancellationToken]) ⇒
Promise.<Array.<Edge>> - .getEdgesBetween(graphGuid, fromNodeGuid, toNodeGuid, [cancellationToken]) ⇒
Promise.<Array.<Edge>> - .getAllNodeEdges(graphGuid, nodeGuid, [cancellationToken]) ⇒
Promise.<Array.<Edge>> - .getChildrenFromNode(graphGuid, nodeGuid, [cancellationToken]) ⇒
Promise.<Array.<Node>> - .getParentsFromNode(graphGuid, nodeGuid, [cancellationToken]) ⇒
Promise.<Array.<Node>> - .getNodeNeighbors(graphGuid, nodeGuid, [cancellationToken]) ⇒
Promise.<Array.<Node>> - .getRoutes(graphGuid, fromNodeGuid, toNodeGuid, [cancellationToken]) ⇒
Promise.<RouteResult> - .readTenants([cancellationToken]) ⇒
Promise.<Array.<TenantMetaData>> - .readTenant(tenantGuid, [cancellationToken]) ⇒
Promise.<TenantMetaData> - .createTenant(tenant, [cancellationToken]) ⇒
Promise.<TenantMetaData> - .updateTenant(tenant, guid, [cancellationToken]) ⇒
Promise.<TenantMetaData> - .deleteTenant(tenantGuid, [cancellationToken]) ⇒
Promise.<Boolean> - .tenantExists(tenantGuid, [cancellationToken]) ⇒
Promise.<boolean> - .tenantDeleteForce(tenantGuid, [cancellationToken]) ⇒
Promise.<Boolean> - .readAllUsers([cancellationToken]) ⇒
Promise.<Array.<UserMetadata>> - .readUser(userGuid, [cancellationToken]) ⇒
Promise.<UserMetadata> - .createUser(user, [cancellationToken]) ⇒
Promise.<UserMetadata> - .existsUser(guid, [cancellationToken]) ⇒
Promise.<boolean> - .updateUser(user, guid, [cancellationToken]) ⇒
Promise.<UserMetadata> - .deleteUser(guid, [cancellationToken]) ⇒
Promise.<Boolean> - .readAllCredentials([cancellationToken]) ⇒
Promise.<Array.<CredentialMetadata>> - .readCredential(guid, [cancellationToken]) ⇒
Promise.<CredentialMetadata> - .createCredential(credential, [cancellationToken]) ⇒
Promise.<CredentialMetadata> - .updateCredential(credential, guid, [cancellationToken]) ⇒
Promise.<CredentialMetadata> - .deleteCredential(guid, [cancellationToken]) ⇒
Promise.<Boolean> - .existsCredential(guid, [cancellationToken]) ⇒
Promise.<boolean> - .readAllTags([cancellationToken]) ⇒
Promise.<Array.<TagMetaData>> - .readTag(guid, [cancellationToken]) ⇒
Promise.<TagMetaData> - .existsTag(guid, [cancellationToken]) ⇒
Promise.<boolean> - .createTag(tag, [cancellationToken]) ⇒
Promise.<TagMetaData> - .updateTag(tag, guid, [cancellationToken]) ⇒
Promise.<TagMetaData> - .deleteTag(guid, [cancellationToken]) ⇒
Promise.<void> - .readAllLabels([cancellationToken]) ⇒
Promise.<Array.<LabelMetadata>> - .readLabel(guid, [cancellationToken]) ⇒
Promise.<LabelMetadata> - .existsLabel(guid, [cancellationToken]) ⇒
Promise.<boolean> - .createLabel(label, [cancellationToken]) ⇒
Promise.<LabelMetadata> - .updateLabel(label, guid, [cancellationToken]) ⇒
Promise.<LabelMetadata> - .deleteLabel(guid, [cancellationToken]) ⇒
Promise.<void> - .readAllVectors([cancellationToken]) ⇒
Promise.<Array.<VectorMetadata>> - .readVector(guid, [cancellationToken]) ⇒
Promise.<VectorMetadata> - .existsVector(guid, [cancellationToken]) ⇒
Promise.<boolean> - .createVector(vector, [cancellationToken]) ⇒
Promise.<VectorMetadata> - .updateVector(vector, guid, [cancellationToken]) ⇒
Promise.<VectorMetadata> - .deleteVector(guid, [cancellationToken]) ⇒
Promise.<void> - .searchVectors(searchReq, [cancellationToken]) ⇒
Promise.<VectorSearchResult> - .generateToken(email, tenantId, password, [cancellationToken]) ⇒
Promise.<Token> - .getTokenDetails(token, [cancellationToken]) ⇒
Promise.<Token> - .getTenantsForEmail(email, [cancellationToken]) ⇒
Promise.<Array.<TenantMetaData>>
- module.exports ⏏
Instantiate the SDK.
| Param | Type | Default | Description |
|---|---|---|---|
| endpoint | string |
"http://localhost:8701/" |
The endpoint URL. |
| [tenantGuid] | string |
The tenant GUID. | |
| [accessKey] | string |
The access key. |
Check if a graph exists by GUID.
Kind: instance method of module.exports
Returns: Promise.<boolean> - - True if the graph exists.
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the graph. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create a graph.
Kind: instance method of module.exports
Returns: Promise.<Graph> - - The created graph.
| Param | Type | Description |
|---|---|---|
| graph | Object |
Information about the graph. |
| graph.GUID | string |
Globally unique identifier (automatically generated if not provided). |
| graph.Name | string |
Name of the graph. |
| graph.Labels | Array.<string> |
Array of labels associated with the graph. |
| graph.Tags | Object |
Key-value pairs of tags. |
| graph.Vectors | Array.<VectorMetadata> |
Array of vector embeddings. |
| graph.Data | Object |
Object data associated with the graph (default is null). |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read all graphs.
Kind: instance method of module.exports
Returns: Promise.<Array.<Graph>> - - An array of graphs.
| Param | Type | Description |
|---|---|---|
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Search graphs.
Kind: instance method of module.exports
Returns: Promise.<SearchResult> - - The search result.
| Param | Type | Description |
|---|---|---|
| searchReq | Object |
Information about the search request. |
| searchReq.GraphGUID | string |
Globally unique identifier for the graph (defaults to an empty GUID). |
| searchReq.Ordering | string |
Ordering of the search results (default is CreatedDescending). |
| searchReq.Expr | Object |
Expression used for the search (default is null). |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read a specific graph.
Kind: instance method of module.exports
Returns: Promise.<Graph> - - The requested graph.
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the graph. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Update a graph.
Kind: instance method of module.exports
Returns: Promise.<Graph> - - The updated graph.
| Param | Type | Description |
|---|---|---|
| graph | Object |
Information about the graph. |
| graph.GUID | string |
Globally unique identifier (automatically generated if not provided). |
| graph.name | string |
Name of the graph. |
| graph.CreatedUtc | Date |
Creation timestamp in UTC (defaults to now). |
| graph.data | Object |
Object data associated with the graph (default is null). |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete a graph.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the graph. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
| force | boolean |
Force recursive deletion of edges and nodes. |
Export a graph to GEXF format.
Kind: instance method of module.exports
Returns: Promise.<string> - - The GEXF XML data.
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the graph. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Execute a batch existence request.
Kind: instance method of module.exports
Returns: Promise.<Object> - - The existence result.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| existenceRequest | Object |
Optional initial data for the existence request. |
| existenceRequest.Nodes | Array.<string> |
Array of node GUIDs. |
| existenceRequest.Edges | Array.<string> |
Array of edge GUIDs. |
| existenceRequest.EdgesBetween | Array.<EdgeBetween> |
Array of EdgeBetween instances. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Check if a node exists by GUID.
Kind: instance method of module.exports
Returns: Promise.<boolean> - - True if the node exists.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| guid | string |
The GUID of the node. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create multiple nodes.
Kind: instance method of module.exports
Returns: Promise.<Array.<Node>> - - The list of created nodes.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| nodes | Array.<Object> |
List of node objects. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create a node.
Kind: instance method of module.exports
Returns: Promise.<Node> - - The created node.
| Param | Type | Description |
|---|---|---|
| node | Object |
Information about the node. |
| node.GUID | string |
Globally unique identifier (automatically generated if not provided). |
| node.GraphGUID | string |
Globally unique identifier for the graph (automatically generated if not provided). |
| node.name | string |
Name of the node. |
| node.data | Object |
Object data associated with the node (default is null). |
| node.CreatedUtc | Date |
Creation timestamp in UTC (defaults to now). |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read nodes for a specific graph.
Kind: instance method of module.exports
Returns: Promise.<Array.<Node>> - - An array of nodes.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Search nodes.
Kind: instance method of module.exports
Returns: Promise.<SearchResult> - - The search result.
| Param | Type | Description |
|---|---|---|
| searchReq | Object |
Information about the search request. |
| searchReq.GraphGUID | string |
Globally unique identifier for the graph (defaults to an empty GUID). |
| searchReq.Ordering | string |
Ordering of the search results (default is CreatedDescending). |
| searchReq.Expr | Object |
Expression used for the search (default is null). |
| graphGuid | string |
The GUID of the graph. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read a specific node.
Kind: instance method of module.exports
Returns: Promise.<Node> - - The requested node.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| nodeGuid | string |
The GUID of the node. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Update a node.
Kind: instance method of module.exports
Returns: Promise.<Node> - - The updated node.
| Param | Type | Description |
|---|---|---|
| node | Object |
Information about the node. |
| node.GUID | string |
Globally unique identifier (automatically generated if not provided). |
| node.GraphGUID | string |
Globally unique identifier for the graph (automatically generated if not provided). |
| node.name | string |
Name of the node. |
| node.data | Object |
Object data associated with the node (default is null). |
| node.CreatedUtc | Date |
Creation timestamp in UTC (defaults to now). |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete a node.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| nodeGuid | string |
The GUID of the node. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete all nodes within a graph.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete multiple nodes within a graph.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| nodeGuids | Array.<string> |
The list of node GUIDs to delete. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Check if an edge exists by GUID.
Kind: instance method of module.exports
Returns: Promise.<boolean> - - True if exists.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| guid | string |
Edge GUID. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create multiple edges.
Kind: instance method of module.exports
Returns: Promise.<Array.<Object>> - - The list of created edges.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| edges | Array.<Object> |
List of edge objects. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create an edge.
Kind: instance method of module.exports
Returns: Promise.<Edge> - - The created edge.
| Param | Type | Default | Description |
|---|---|---|---|
| edge | Object |
Information about the edge. | |
| [edge.GUID] | string |
Globally unique identifier for the edge (automatically generated if not provided). | |
| [edge.GraphGUID] | string |
Globally unique identifier for the graph (automatically generated if not provided). | |
| [edge.Name] | string |
Name of the edge. | |
| [edge.From] | string |
Globally unique identifier of the from node. | |
| [edge.To] | string |
Globally unique identifier of the to node. | |
| [edge.Cost] | number |
0 |
Cost associated with the edge (default is 0). |
| [edge.CreatedUtc] | Date |
Creation timestamp in UTC (defaults to current UTC time). | |
| [edge.Data] | Object |
Additional object data associated with the edge (default is null). | |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read edges.
Kind: instance method of module.exports
Returns: Promise.<Array.<Edge>> - - List of edges.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Search edges.
Kind: instance method of module.exports
Returns: Promise.<SearchResult> - - The search result.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| searchReq | Object |
Information about the search request. |
| searchReq.GraphGUID | string |
Globally unique identifier for the graph (defaults to an empty GUID). |
| searchReq.Ordering | string |
Ordering of the search results (default is CreatedDescending). |
| searchReq.Expr | Object |
Expression used for the search (default is null). |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read an edge.
Kind: instance method of module.exports
Returns: Promise.<Edge> - - The requested edge.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| edgeGuid | string |
Edge GUID. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Update an edge.
Kind: instance method of module.exports
Returns: Promise.<Edge> - - The updated edge.
| Param | Type | Default | Description |
|---|---|---|---|
| edge | Object |
Information about the edge. | |
| [edge.GUID] | string |
Globally unique identifier for the edge (automatically generated if not provided). | |
| [edge.GraphGUID] | string |
Globally unique identifier for the graph (automatically generated if not provided). | |
| [edge.Name] | string |
Name of the edge. | |
| [edge.From] | string |
Globally unique identifier of the from node. | |
| [edge.To] | string |
Globally unique identifier of the to node. | |
| [edge.Cost] | number |
0 |
Cost associated with the edge (default is 0). |
| [edge.CreatedUtc] | Date |
Creation timestamp in UTC (defaults to current UTC time). | |
| [edge.Data] | Object |
Additional object data associated with the edge (default is null). | |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete an edge.
Kind: instance method of module.exports
Returns: Promise.<void> - - Promise representing the completion of the deletion.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| edgeGuid | string |
Edge GUID. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete all edges within a graph.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete multiple edges within a graph.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
The GUID of the graph. |
| edgeGuids | Array.<string> |
The list of edge GUIDs to delete. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Get edges from a node.
Kind: instance method of module.exports
Returns: Promise.<Array.<Edge>> - - Edges.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| nodeGuid | string |
Node GUID. |
| [cancellationToken] | AbortSignal |
Abort signal for cancellation. |
Get edges to a node.
Kind: instance method of module.exports
Returns: Promise.<Array.<Edge>> - - Edges.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| nodeGuid | string |
Node GUID. |
| [cancellationToken] | AbortSignal |
Abort signal for cancellation. |
module.exports.getEdgesBetween(graphGuid, fromNodeGuid, toNodeGuid, [cancellationToken]) ⇒ Promise.<Array.<Edge>>
Get edges from a given node to a given node.
Kind: instance method of module.exports
Returns: Promise.<Array.<Edge>> - - Edges.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| fromNodeGuid | string |
From node GUID. |
| toNodeGuid | string |
To node GUID. |
| [cancellationToken] | AbortSignal |
Abort signal for cancellation. |
Get all edges to or from a node.
Kind: instance method of module.exports
Returns: Promise.<Array.<Edge>> - - Edges.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| nodeGuid | string |
Node GUID. |
| [cancellationToken] | AbortSignal |
Abort signal for cancellation. |
module.exports.getChildrenFromNode(graphGuid, nodeGuid, [cancellationToken]) ⇒ Promise.<Array.<Node>>
Get child nodes from a node.
Kind: instance method of module.exports
Returns: Promise.<Array.<Node>> - - Child nodes.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| nodeGuid | string |
Node GUID. |
| [cancellationToken] | AbortSignal |
Abort signal for cancellation. |
module.exports.getParentsFromNode(graphGuid, nodeGuid, [cancellationToken]) ⇒ Promise.<Array.<Node>>
Get parent nodes from a node.
Kind: instance method of module.exports
Returns: Promise.<Array.<Node>> - - Parent nodes.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| nodeGuid | string |
Node GUID. |
| [cancellationToken] | AbortSignal |
Abort signal for cancellation. |
Get neighboring nodes from a node.
Kind: instance method of module.exports
Returns: Promise.<Array.<Node>> - - Neighboring nodes.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| nodeGuid | string |
Node GUID. |
| [cancellationToken] | AbortSignal |
Abort signal for cancellation. |
module.exports.getRoutes(graphGuid, fromNodeGuid, toNodeGuid, [cancellationToken]) ⇒ Promise.<RouteResult>
Get routes between two nodes.
Kind: instance method of module.exports
Returns: Promise.<RouteResult> - - Routes.
| Param | Type | Description |
|---|---|---|
| graphGuid | string |
Graph GUID. |
| fromNodeGuid | string |
From node GUID. |
| toNodeGuid | string |
To node GUID. |
| [cancellationToken] | AbortSignal |
Abort signal for cancellation. |
Read all tenants.
Kind: instance method of module.exports
Returns: Promise.<Array.<TenantMetaData>> - - An array of tenants.
| Param | Type | Description |
|---|---|---|
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read a tenant.
Kind: instance method of module.exports
Returns: Promise.<TenantMetaData> - - The tenant.
| Param | Type | Description |
|---|---|---|
| tenantGuid | string |
The GUID of the tenant. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create a tenant.
Kind: instance method of module.exports
Returns: Promise.<TenantMetaData> - - The created tenant.
| Param | Type | Description |
|---|---|---|
| tenant | TenantMetaData |
The tenant to create. |
| tenant.name | String |
The name of the tenant. |
| tenant.Active | boolean |
Indicates if tenant is active. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Update a tenant.
Kind: instance method of module.exports
Returns: Promise.<TenantMetaData> - - The updated tenant.
| Param | Type | Description |
|---|---|---|
| tenant | TenantMetaData |
The tenant to update. |
| tenant.name | String |
The name of the tenant. |
| tenant.Active | boolean |
Indicates if tenant is active. |
| guid | string |
The GUID of the tenant. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete a tenant.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| tenantGuid | string |
The GUID of the tenant. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Tenant exists.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| tenantGuid | string |
The GUID of the tenant. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Tenant delete force.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| tenantGuid | string |
The GUID of the tenant. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read all users.
Kind: instance method of module.exports
Returns: Promise.<Array.<UserMetadata>> - - An array of users.
| Param | Type | Description |
|---|---|---|
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read a user.
Kind: instance method of module.exports
Returns: Promise.<UserMetadata> - - The user.
| Param | Type | Description |
|---|---|---|
| userGuid | string |
The GUID of the user. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create a user.
Kind: instance method of module.exports
Returns: Promise.<UserMetadata> - - The created user.
| Param | Type | Description |
|---|---|---|
| user | UserMetadata |
The user to create. |
| user.FirstName | String |
The first name of the user. |
| user.LastName | String |
The last name of the user. |
| user.Active | boolean |
Indicates if user is active. |
| user.Email | string |
The email of the user. |
| user.Password | string |
The password of the user. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
User exists.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the user. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Update a user.
Kind: instance method of module.exports
Returns: Promise.<UserMetadata> - - The updated user.
| Param | Type | Description |
|---|---|---|
| user | UserMetadata |
The user to update. |
| user.FirstName | String |
The first name of the user. |
| user.LastName | String |
The last name of the user. |
| user.Active | boolean |
Indicates if user is active. |
| user.Email | string |
The email of the user. |
| user.Password | string |
The password of the user. |
| guid | string |
The GUID of the user. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete a user.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the user. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read all credentials.
Kind: instance method of module.exports
Returns: Promise.<Array.<CredentialMetadata>> - - An array of credentials.
| Param | Type | Description |
|---|---|---|
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read a credential.
Kind: instance method of module.exports
Returns: Promise.<CredentialMetadata> - - The credential.
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the credential. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create a credential.
Kind: instance method of module.exports
Returns: Promise.<CredentialMetadata> - - The created credential.
| Param | Type | Description |
|---|---|---|
| credential | CredentialMetadata |
The credential to create. |
| credential.Name | string |
The name of the credential. |
| credential.BearerToken | string |
The bearer token of the credential. |
| credential.Active | boolean |
Indicates if credential is active. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
module.exports.updateCredential(credential, guid, [cancellationToken]) ⇒ Promise.<CredentialMetadata>
Update a credential.
Kind: instance method of module.exports
Returns: Promise.<CredentialMetadata> - - The updated credential.
| Param | Type | Description |
|---|---|---|
| credential | CredentialMetadata |
The credential to update. |
| credential.Name | string |
The name of the credential. |
| credential.BearerToken | string |
The bearer token of the credential. |
| credential.Active | boolean |
Indicates if credential is active. |
| guid | string |
The GUID of the credential. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete a credential.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the credential. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Credential exists.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the credential. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read all tags.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read a tag.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the tag. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Tag exists.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the tag. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create a tag.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| tag | TagMetaData |
The tag to create. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Update a tag.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| tag | TagMetaData |
The tag to update. |
| guid | string |
The GUID of the tag. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete a tag.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the tag. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read all labels.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read a label.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the label. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Label exists.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the label. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create a label.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| label | LabelMetadata |
The label to create. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Update a label.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| label | LabelMetadata |
The label to update. |
| guid | string |
The GUID of the label. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete a label.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the label. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read all vectors.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Read a vector.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the vector. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Vector exists.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the vector. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Create a vector.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| vector | VectorMetadata |
The vector to create. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Update a vector.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| vector | VectorMetadata |
The vector to update. |
| guid | string |
The GUID of the vector. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Delete a vector.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| guid | string |
The GUID of the vector. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Search Vectors.
Kind: instance method of module.exports
Returns: Promise.<VectorSearchResult> - - The search result.
| Param | Type | Description |
|---|---|---|
| searchReq | Object |
Information about the search request. |
| searchReq.GraphGUID | string |
Globally unique identifier for the graph (defaults to an empty GUID). |
| searchReq.Domain | string |
Ordering of the search results (default is CreatedDescending). |
| searchReq.SearchType | String |
Expression used for the search (default is null). |
| searchReq.Labels | Array.<string> |
The domain of the search type. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Generate an authentication token.
Kind: instance method of module.exports
Returns: Promise.<Token> - The generated authentication token
| Param | Type | Description |
|---|---|---|
string |
The user's email address. | |
| tenantId | string |
The tenant ID. |
| password | string |
The user's password. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Fetch details about an authentication token.
Kind: instance method of module.exports
Returns: Promise.<Token> - The token details
| Param | Type | Description |
|---|---|---|
| token | string |
The authentication token to inspect. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Get tenants associated with an email address.
Kind: instance method of module.exports
Returns: Promise.<Array.<TenantMetaData>> - Array of tenants associated with the email
| Param | Type | Description |
|---|---|---|
string |
The email address to lookup tenants for. | |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
SDK Base class for making API calls with logging and timeout functionality.
- SdkBase
- module.exports ⏏
- new module.exports(endpoint, [tenantGuid], [accessKey])
- .tenantGuid ⇒
string - .tenantGuid
- .accessKey ⇒
string - .accessKey
- .accessToken ⇒
string - .accessToken
- .header ⇒
string - .header
- .endpoint ⇒
string - .endpoint
- .timeoutMs ⇒
number - .timeoutMs
- .log(sev, msg)
- .validateConnectivity([cancellationToken]) ⇒
Promise.<boolean> - .putCreate(url, obj, model, [cancellationToken]) ⇒
Promise.<Object> - .head(url, [cancellationToken]) ⇒
Promise.<boolean> - .get(url, model, [cancellationToken], [headers]) ⇒
Promise.<Object> - .getDataInBytes(url, [cancellationToken]) ⇒
Promise.<Object> - .getMany(url, model, [cancellationToken], [headers]) ⇒
Promise.<Array> - .putUpdate(url, obj, model, [cancellationToken]) ⇒
Promise.<Object> - .delete(url, [cancellationToken]) ⇒
Promise.<void> - .post(url, data, model, [cancellationToken]) ⇒
Promise.<Object> - .deleteMany(url, obj, [cancellationToken]) ⇒
Promise.<void> - .postBatch(url, obj, model, [cancellationToken]) ⇒
Promise.<(Object|null)>
- module.exports ⏏
Creates an instance of SdkBase.
Throws:
ErrorThrows an error if the endpoint is null or empty.
| Param | Type | Description |
|---|---|---|
| endpoint | string |
The API endpoint base URL. |
| [tenantGuid] | string |
The tenant GUID. |
| [accessKey] | string |
The access key. |
Getter for the tenant GUID.
Kind: instance property of module.exports
Returns: string - The tenant GUID.
Setter for the tenant GUID.
Kind: instance property of module.exports
Throws:
ErrorThrows an error if the tenant GUID is null or empty.
| Param | Type | Description |
|---|---|---|
| value | string |
The tenant GUID. |
Getter for the access key.
Kind: instance property of module.exports
Returns: string - The access key.
Setter for the access key.
Kind: instance property of module.exports
Throws:
ErrorThrows an error if the access key is null or empty.
| Param | Type | Description |
|---|---|---|
| value | string |
The access key. |
Getter for the access token.
Kind: instance property of module.exports
Returns: string - The access token.
Setter for the access token.
Kind: instance property of module.exports
Throws:
ErrorThrows an error if the access token is null or empty.
| Param | Type | Description |
|---|---|---|
| value | string |
The access token. |
Getter for the request header prefix.
Kind: instance property of module.exports
Returns: string - The header prefix.
Setter for the request header prefix.
Kind: instance property of module.exports
| Param | Type | Description |
|---|---|---|
| value | string |
The header prefix. |
Getter for the API endpoint.
Kind: instance property of module.exports
Returns: string - The endpoint URL.
Setter for the API endpoint.
Kind: instance property of module.exports
Throws:
ErrorThrows an error if the endpoint is null or empty.
| Param | Type | Description |
|---|---|---|
| value | string |
The endpoint URL. |
Getter for the timeout in milliseconds.
Kind: instance property of module.exports
Returns: number - The timeout in milliseconds.
Setter for the timeout in milliseconds.
Kind: instance property of module.exports
Throws:
ErrorThrows an error if the timeout is less than 1.
| Param | Type | Description |
|---|---|---|
| value | number |
Timeout value in milliseconds. |
Logs a message with a severity level.
Kind: instance method of module.exports
| Param | Type | Description |
|---|---|---|
| sev | string |
The severity level (e.g., SeverityEnum.Debug, 'warn'). |
| msg | string |
The message to log. |
Validates API connectivity using a HEAD request.
Kind: instance method of module.exports
Returns: Promise.<boolean> - Resolves to true if the connection is successful.
Throws:
ErrorRejects with the error in case of failure.
| Param | Type | Description |
|---|---|---|
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Sends a PUT request to create an object at a given URL.
Kind: instance method of module.exports
Returns: Promise.<Object> - Resolves with the created object.
Throws:
ErrorRejects if the URL or object is invalid or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL where the object is created. |
| obj | Object |
The object to be created. |
| model | Class |
Modal to deserialize on |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Checks if an object exists at a given URL using a HEAD request.
Kind: instance method of module.exports
Returns: Promise.<boolean> - Resolves to true if the object exists.
Throws:
ErrorRejects if the URL is invalid or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL to check. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Retrieves an object from a given URL using a GET request.
Kind: instance method of module.exports
Returns: Promise.<Object> - Resolves with the retrieved object.
Throws:
ErrorRejects if the URL is invalid or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL of the object. |
| model | Class |
Modal to deserialize on |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
| [headers] | Object |
Additional headers. |
Retrieves raw data from a given URL using a GET request.
Kind: instance method of module.exports
Returns: Promise.<Object> - Resolves with the retrieved data.
Throws:
ErrorRejects if the URL is invalid or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL of the object. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Retrieves a list of objects from a given URL using a GET request.
Kind: instance method of module.exports
Returns: Promise.<Array> - Resolves with the list of retrieved objects.
Throws:
ErrorRejects if the URL is invalid or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL of the objects. |
| model | Class |
Modal to deserialize on |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
| [headers] | Object |
Additional headers. |
Sends a PUT request to update an object at a given URL.
Kind: instance method of module.exports
Returns: Promise.<Object> - Resolves with the created object.
Throws:
ErrorRejects if the URL or object is invalid or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL where the object is created. |
| obj | Object |
The object to be created. |
| model | Class |
Modal to deserialize on |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Sends a DELETE request to remove an object at a given URL.
Kind: instance method of module.exports
Returns: Promise.<void> - Resolves if the object is successfully deleted.
Throws:
ErrorRejects if the URL is invalid or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL of the object to delete. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Submits data using a POST request to a given URL.
Kind: instance method of module.exports
Returns: Promise.<Object> - Resolves with the response data.
Throws:
ErrorRejects if the URL or data is invalid or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL to post data to. |
| data | Object | string |
The data to send in the POST request. |
| model | Class |
Modal to deserialize on |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Sends a DELETE request to remove an object at a given URL.
Kind: instance method of module.exports
Returns: Promise.<void> - Resolves if the object is successfully deleted.
Throws:
ErrorRejects if the URL is invalid, the object is not serializable, or if the request fails.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL of the object to delete. |
| obj | Object |
The object to be created. |
| [cancellationToken] | AbortController |
Optional cancellation token for cancelling the request. |
Submits a POST request.
Kind: instance method of module.exports
Returns: Promise.<(Object|null)> - The response data parsed as an object of type Object, or null if unsuccessful.
Throws:
ErrorIf the URL is invalid or the object cannot be serialized to JSON.
| Param | Type | Description |
|---|---|---|
| url | string |
The URL to which the request is sent. |
| obj | Object |
The object to send in the POST request body. |
| model | Class |
Modal to deserialize on |
| [cancellationToken] | AbortController |
Optional cancellation token to cancel the request. |