Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# TerminusDB-Client
TerminusDB Client Javascript
==========================

[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=master)](https://travis-ci.com/terminusdb/terminusdb-client)
[![Discord online](https://img.shields.io/discord/689805612053168129?color=7289da&logo=Discord&label=Discord%20chat)](https://discord.gg/yTJKAma)
[![Discourse topics](https://img.shields.io/discourse/topics?color=yellow&logo=Discourse&server=https%3A%2F%2Fdiscuss.terminusdb.com%2F)](https://discuss.terminusdb.com/)
[![Follow on Twitter](https://img.shields.io/twitter/follow/terminusdb?color=skyblue&label=Follow%20on%20Twitter&logo=twitter&style=flat)](https://twitter.com/TerminusDB)

**Development status ⚙️**

[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=main)](https://travis-ci.com/terminusdb/terminusdb-client)
[![Coverage Status](https://coveralls.io/repos/github/terminusdb/terminusdb-client/badge.svg?branch=master)](https://coveralls.io/repos/github/terminusdb/terminusdb-client/badge.svg?branch=master)

**NPM Package status 📦**

[![npm version shields.io](https://img.shields.io/npm/v/@terminusdb/terminusdb-client?logo=npm)](https://www.npmjs.com/package/@terminusdb/terminusdb-client)
[![PyPI download month](https://img.shields.io/npm/dw/@terminusdb/terminusdb-client?color=red&label=npm%20package&logo=npm&style=flat)](https://www.npmjs.com/package/@terminusdb/terminusdb-client)

Promise based terminus client for the browser and node.js

## Requirements
Expand Down Expand Up @@ -132,7 +144,7 @@ const client = new TerminusClient.WOQLClient("http://127.0.0.1:6363/", {

## API

The API of the most recent release is documented at: <https://docs.terminusdb.com/v4.2/#/reference/API>
The API of the most recent release is documented at: <https://terminusdb.com/docs/v10.0/#/reference/reference-api>

## Report Issues

Expand Down
24 changes: 18 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# TerminusDB-Client
TerminusDB Client Javascript
==========================

[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=master)](https://travis-ci.com/terminusdb/terminusdb-client)
[![Discord online](https://img.shields.io/discord/689805612053168129?color=7289da&logo=Discord&label=Discord%20chat)](https://discord.gg/yTJKAma)
[![Discourse topics](https://img.shields.io/discourse/topics?color=yellow&logo=Discourse&server=https%3A%2F%2Fdiscuss.terminusdb.com%2F)](https://discuss.terminusdb.com/)
[![Follow on Twitter](https://img.shields.io/twitter/follow/terminusdb?color=skyblue&label=Follow%20on%20Twitter&logo=twitter&style=flat)](https://twitter.com/TerminusDB)

**Development status ⚙️**

[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=main)](https://travis-ci.com/terminusdb/terminusdb-client)
[![Coverage Status](https://coveralls.io/repos/github/terminusdb/terminusdb-client/badge.svg?branch=master)](https://coveralls.io/repos/github/terminusdb/terminusdb-client/badge.svg?branch=master)

**NPM Package status 📦**

[![npm version shields.io](https://img.shields.io/npm/v/@terminusdb/terminusdb-client?logo=npm)](https://www.npmjs.com/package/@terminusdb/terminusdb-client)
[![PyPI download month](https://img.shields.io/npm/dw/@terminusdb/terminusdb-client?color=red&label=npm%20package&logo=npm&style=flat)](https://www.npmjs.com/package/@terminusdb/terminusdb-client)

Promise based terminus client for the browser and node.js

## Requirements
Expand Down Expand Up @@ -47,7 +59,7 @@ Download the terminusdb-client.min.js file from the /dist directory and save it
This example creates a simple dataProduct, starting to create a database model the schema
and insert a simple document

For the [full Documentation](https://terminusdb.com/docs/reference/js-client)
For the [full Documentation](https://terminusdb.github.io/terminusdb-client-js/)

```javascript
const TerminusClient = require("@terminusdb/terminusdb-client");
Expand Down Expand Up @@ -132,13 +144,13 @@ const client = new TerminusClient.WOQLClient("http://127.0.0.1:6363/", {

## API

The API is documented at: https://terminusdb.com/docs/reference/js-client/core/#terminusdb-client-api
The API of the most recent release is documented at: <https://terminusdb.com/docs/v10.0/#/reference/reference-api>

## Report Issues

If you have encounter any issues, please report it with your os and environment setup, version that you are using and a simple reproducible case.

If you encounter other questions, you can ask in our community [forum](https://community.terminusdb.com/) or [Slack channel](http://bit.ly/terminusdb-slack).
If you encounter other questions, you can ask in our [Discord Server](https://discord.gg/hTU3XWSzuZ).

## Contribute

Expand All @@ -150,4 +162,4 @@ Please check [Contributing.md](Contributing.md) for more information.

The APACHE 2.0 License

Copyright (c) 2019
Copyright (c) 2019
3 changes: 2 additions & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [user](api/woqlClient.js?id=user)
- [userOrganization](api/woqlClient.js?id=userOrganization)
- [databases](api/woqlClient.js?id=databases)
- [userOrganizations](api/woqlClient.js?id=userOrganizations)
- [databaseInfo](api/woqlClient.js?id=databaseInfo)
- [db](api/woqlClient.js?id=db)
- [setSystemDb](api/woqlClient.js?id=setSystemDb)
Expand Down Expand Up @@ -152,7 +153,7 @@
- [commits](api/woqlLibrary.js?id=commits)
- [previousCommits](api/woqlLibrary.js?id=previousCommits)
- [first_commit](api/woqlLibrary.js?id=first_commit)
- [TypeDef](api/typedef.js?id=Typedefs)
- [TypeDef](api/typedef.js?id=TypeDef)
- [DocParamsGet](api/typedef.js?id=DocParamsGet)
- [DocParamsPost](api/typedef.js?id=DocParamsPost)
- [DocParamsPut](api/typedef.js?id=DocParamsPut)
Expand Down
129 changes: 67 additions & 62 deletions docs/api/typedef.js.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,70 @@
## Typedefs
## DocParamsGet
#### DocParamsGet : <code>Object</code>

## TypeDef
#### TypeDef
Type definations


### DocParamsGet
#### DocParamsGet: ` Object`
the GET document interface query parameters

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [graph_type] | <code>string</code> | <code>&quot;instance&quot;</code> | instance|schema default value is instance. Used to switch between getting documents from the instance or the schema graph. |
| [type] | <code>string</code> | | only documents of the given type are returned. |
| [id] | <code>string</code> | | only the document with the given ID is returned. |
| [prefixed] | <code>boolean</code> | <code>true</code> | return IRIs using a prefixed notation wherever possible. If false, full IRIs are used. |
| [minimized] | <code>boolean</code> | <code>false</code> | return the documents with very little whitespace. Each json document will be on its own line. |
| [unfold] | <code>boolean</code> | <code>true</code> | any subdocuments contained in the returned document are returned too. If false, these are referred to by their ID instead. |
| [skip] | <code>number</code> | <code>0</code> | How many results to skip |
| [count] | <code>number</code> | | count - How many results to return. If this option is absent, all results are returned. |
| [as_list] | <code>boolean</code> | <code>false</code> | If true, don't return a stream of json objects, but a json list. |
| [graph_type] | <code>string</code> | | instance|schema default value is instance |


## DocParamsPost
#### DocParamsPost : <code>Object</code>
| Name | Type | Description |
| --- | --- | --- |
| [graph_type] | <code>GraphType</code> | instance|schema, default value is instance. Used to switch between getting documents from the instance or the schema graph. |
| [type] | <code>string</code> | only documents of the given type are returned. |
| [id] | <code>string</code> | only the document with the given ID is returned. |
| [prefixed] | <code>boolean</code> | default is true, return IRIs using a prefixed notation wherever possible. If false, full IRIs are used. |
| [minimized] | <code>boolean</code> | default is false, return the documents with very little whitespace. Each json document will be on its own line. |
| [unfold] | <code>boolean</code> | default is false, any subdocuments contained in the returned document are returned too. If false, these are referred to by their ID instead. |
| [skip] | <code>number</code> | default is 0, How many results to skip |
| [count] | <code>number</code> | count - How many results to return. If this option is absent, all results are returned. |
| [as_list] | <code>boolean</code> | default is false, If true, don't return a stream of json objects, but a json list. |
| [graph_type] | <code>string</code> | instance|schema default value is instance |


### DocParamsPost
#### DocParamsPost: ` Object`
the POST document interface query parameters

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [graph_type] | <code>string</code> | <code>&quot;instance&quot;</code> | instance|schema Used to switch between getting documents from the instance or the schema graph. |
| [full_replace] | <code>boolean</code> | <code>false</code> | If true, all existing documents are deleted before inserting the posted documents. This allows the full replacement of the contents of a database. This is especially useful for replacing the schema. |
| Name | Type | Description |
| --- | --- | --- |
| [graph_type] | <code>GraphType</code> | default is instance instance|schema Used to switch between getting documents from the instance or the schema graph. |
| [full_replace] | <code>boolean</code> | default is false, If true, all existing documents are deleted before inserting the posted documents. This allows the full replacement of the contents of a database. This is especially useful for replacing the schema. |


## DocParamsPut
#### DocParamsPut : <code>Object</code>
### DocParamsPut
#### DocParamsPut: ` Object`
the PUT document interface query parameters

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [graph_type] | <code>string</code> | <code>&quot;instance&quot;</code> | instance|schema Used to switch between getting documents from the instance or the schema graph. |
| Name | Type | Description |
| --- | --- | --- |
| [graph_type] | <code>GraphType</code> | default is instance, instance|schema Used to switch between getting documents from the instance or the schema graph. |


## DocParamsDelete
#### DocParamsDelete : <code>Object</code>
### DocParamsDelete
#### DocParamsDelete: ` Object`
the DELETE document interface query parameters

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [graph_type] | <code>string</code> | <code>&quot;instance&quot;</code> | instance|schema Used to switch between getting documents from the instance or the schema graph. |
| id | <code>string</code> \| <code>array</code> | | a single id or a list of ids to delete. |
| [nuke] | <code>booleam</code> | <code>false</code> | If true, delete everything at this resource location (dangerous!). |
| Name | Type | Description |
| --- | --- | --- |
| [graph_type] | <code>GraphType</code> | default is instance, instance|schema Used to switch between getting documents from the instance or the schema graph. |
| id | <code>string</code> \| <code>array</code> | a single id or a list of ids to delete. |
| [nuke] | <code>booleam</code> | default is false, If true, delete everything at this resource location (dangerous!). |


## GraphRef
#### GraphRef : <code>&quot;schema/main&quot;</code> \| <code>&quot;instance/main&quot;</code> \| <code>string</code>
### GraphRef
#### GraphRef: ` "schema/main"` | ` "instance/main" ` | ` string `

## DataFormatObj
#### DataFormatObj : <code>Object</code>
### DataFormatObj
#### DataFormatObj: ` Object`
(export/import)

**Properties**
Expand All @@ -70,17 +75,17 @@ the DELETE document interface query parameters
| [format_header] | <code>string</code> | header format type |


## FuntionType
#### FuntionType : <code>&quot;add\_quad&quot;</code> \| <code>&quot;delete\_quad&quot;</code> \| <code>&quot;add\_triple&quot;</code> \| <code>&quot;delete\_triple&quot;</code> \| <code>&quot;quad&quot;</code> \| <code>&quot;triple&quot;</code>
### FuntionType
#### FuntionType: ` "add_quad"` | ` "delete_quad" ` | ` "add_triple" ` | ` "delete_triple" ` | ` "quad" ` | ` "triple" `

## ResourceType
#### ResourceType : <code>&quot;commits&quot;</code> \| <code>&quot;meta&quot;</code> \| <code>&quot;branch&quot;</code> \| <code>&quot;ref&quot;</code> \| <code>&quot;repo&quot;</code> \| <code>&quot;db&quot;</code>
### ResourceType
#### ResourceType: ` "commits"` | ` "meta" ` | ` "branch" ` | ` "ref" ` | ` "repo" ` | ` "db" `

## GraphType
#### GraphType : <code>&quot;instance&quot;</code> \| <code>&quot;schema&quot;</code>
### GraphType
#### GraphType: ` "instance"` | ` "schema" `

## CredentialObj
#### CredentialObj : <code>Object</code>
### CredentialObj
#### CredentialObj: ` Object`
**Properties**

| Name | Type | Description |
Expand All @@ -90,11 +95,11 @@ the DELETE document interface query parameters
| key | <code>string</code> | the connection key |


## ActionType
#### ActionType : <code>&#x27;graph&#x27;</code> \| <code>&#x27;db&#x27;</code> \| <code>&#x27;clone&#x27;</code> \| <code>&#x27;triples&#x27;</code> \| <code>&#x27;woql&#x27;</code> \| <code>&#x27;fetch&#x27;</code> \| <code>&#x27;pull&#x27;</code> \| <code>&#x27;rebase&#x27;</code> \| <code>&#x27;branch&#x27;</code> \| <code>&#x27;reset&#x27;</code> \| <code>&#x27;push&#x27;</code> \| <code>&#x27;squash&#x27;</code>
### ActionType
#### ActionType: ` 'graph'` | ` 'db' ` | ` 'clone' ` | ` 'triples' ` | ` 'woql' ` | ` 'fetch' ` | ` 'pull' ` | ` 'rebase' ` | ` 'branch' ` | ` 'reset' ` | ` 'push' ` | ` 'squash' `

## ParamsObj
#### ParamsObj : <code>Object</code>
### ParamsObj
#### ParamsObj: ` Object`
**Properties**

| Name | Type | Description |
Expand All @@ -104,14 +109,14 @@ the DELETE document interface query parameters
| [user] | <code>string</code> | the user id, we use this for basic authentication and for identify the commits author |
| [organization] | <code>string</code> | set organization to this id |
| [db] | <code>string</code> | set cursor to this db |
| [repo] | [<code>RepoType</code>](#RepoType) \| <code>string</code> | set cursor to this repo |
| [repo] | <code>RepoType</code> \| <code>string</code> | set cursor to this repo |
| [branch] | <code>string</code> | set branch to this id |
| [ref] | <code>string</code> | set commit ref |
| [default_branch_id] | <code>string</code> | set the default branch id |


## RolesObj
#### RolesObj : <code>Object</code>
### RolesObj
#### RolesObj: ` Object`
**Properties**

| Name | Type | Description |
Expand All @@ -123,11 +128,11 @@ the DELETE document interface query parameters
| [invitation] | <code>string</code> | - |


## RepoType
#### RepoType : <code>&quot;local&quot;</code> \| <code>&quot;remote&quot;</code>
### RepoType
#### RepoType: ` "local"` | ` "remote" `

## DbDetails
#### DbDetails : <code>Object</code>
### DbDetails
#### DbDetails: ` Object`
**Properties**

| Name | Type | Description |
Expand All @@ -142,8 +147,8 @@ the DELETE document interface query parameters
| [schema] | <code>boolean</code> | if set to true, a schema graph will be created |


## RemoteRepoDetails
#### RemoteRepoDetails : <code>Object</code>
### RemoteRepoDetails
#### RemoteRepoDetails: ` Object`
{remote: "origin", "remote_branch": "main", "author": "admin", "message": "message"}

**Properties**
Expand All @@ -156,8 +161,8 @@ the DELETE document interface query parameters
| [message] | <code>string</code> | the update commit message |


## CloneSourceDetails
#### CloneSourceDetails : <code>Object</code>
### CloneSourceDetails
#### CloneSourceDetails: ` Object`
**Properties**

| Name | Type | Description |
Expand Down
4 changes: 2 additions & 2 deletions docs/api/woql.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,11 @@ Orders the results of the contained subquery by a precedence list of variables

| Param | Type | Description |
| --- | --- | --- |
| ...varNames | <code>string</code> | A sequence of variables, by which to order the results, each optionally followed by either “asc” or “desc” to represent order |
| ...varNames | <code>string</code> | A sequence of variables, by which to order the results, each optionally followed by either “asc” or “desc” to represent order as a list, by default it will sort the variable in ascending order |

**Example**
```js
WOQL.order_by("v:A", "v:B asc", "v:C desc").triple("v:A", "v:B", "v:C");
WOQL.order_by("v:A", ["v:B", "asc"], ["v:C", "desc"]).triple("v:A", "v:B", "v:C");
```

### group_by
Expand Down
22 changes: 16 additions & 6 deletions docs/api/woqlClient.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,21 @@ Retrieves a list of databases (id, organization, label, comment) that the curren
const my_dbs = client.databases()
```

### userOrganizations
#### woqlClient.userOrganizations([orgList]) ⇒ <code>array</code>
Retrieves a list of databases (id, organization, label, comment) that the current user has access to on the server. Note that this requires the client to call connect() first.

**Returns**: <code>array</code> - the user databases list

| Param | Type | Description |
| --- | --- | --- |
| [orgList] | <code>array</code> | a list of databases the user has access to on the server, each having: |

**Example**
```js
const my_dbs = client.databases()
```

### databaseInfo
#### woqlClient.databaseInfo([dbId]) ⇒ <code>object</code>
Gets the database's details
Expand Down Expand Up @@ -447,12 +462,7 @@ client.remoteAuth({"key":"dhfmnmjglkrelgkptohkn","type":"jwt"})
#### woqlClient.author() ⇒ <code>string</code>
Gets the string that will be written into the commit log for the current user

**Returns**: <code>string</code> - the current user

| Param | Type | Description |
| --- | --- | --- |
| [aName] | <code>string</code> | the id to write into commit logs as the author string (normally an email address) |

**Returns**: <code>string</code> - the current user
**Example**
```js
client.author()
Expand Down
5 changes: 4 additions & 1 deletion docs/api/woqlLibrary.js.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

## WOQLLibrary
#### WOQLLibrary()
#### WOQLLibrary
**License**: Apache Version 2

#### new WOQLLibrary()
Library Functions to manage the commits graph

**Example**
Expand Down
4 changes: 4 additions & 0 deletions docs/createDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ function createFile(filePath, options, outputDir) {
}
////([\w-]+)(.js)/
function getFileName(filePath) {

if(filePath === '_sidebar.js') {
return '_sidebar';
}
const regEx = /[\w-]+\.js/;
return filePath.match(regEx)[0]
}
Expand Down
Loading