Skip to content

Commit 2b8d59b

Browse files
Merge pull request #64 from terminusdb/fixAutoDocs
fixes #62 #56
2 parents 4b33e89 + 7d27296 commit 2b8d59b

File tree

13 files changed

+169
-87
lines changed

13 files changed

+169
-87
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
# TerminusDB-Client
1+
TerminusDB Client Javascript
2+
==========================
23

3-
[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=master)](https://travis-ci.com/terminusdb/terminusdb-client)
4+
[![Discord online](https://img.shields.io/discord/689805612053168129?color=7289da&logo=Discord&label=Discord%20chat)](https://discord.gg/yTJKAma)
5+
[![Discourse topics](https://img.shields.io/discourse/topics?color=yellow&logo=Discourse&server=https%3A%2F%2Fdiscuss.terminusdb.com%2F)](https://discuss.terminusdb.com/)
6+
[![Follow on Twitter](https://img.shields.io/twitter/follow/terminusdb?color=skyblue&label=Follow%20on%20Twitter&logo=twitter&style=flat)](https://twitter.com/TerminusDB)
7+
8+
**Development status ⚙️**
9+
10+
[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=main)](https://travis-ci.com/terminusdb/terminusdb-client)
411
[![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)
512

13+
**NPM Package status 📦**
14+
15+
[![npm version shields.io](https://img.shields.io/npm/v/@terminusdb/terminusdb-client?logo=npm)](https://www.npmjs.com/package/@terminusdb/terminusdb-client)
16+
[![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)
17+
618
Promise based terminus client for the browser and node.js
719

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

133145
## API
134146

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

137149
## Report Issues
138150

docs/README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
# TerminusDB-Client
1+
TerminusDB Client Javascript
2+
==========================
23

3-
[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=master)](https://travis-ci.com/terminusdb/terminusdb-client)
4+
[![Discord online](https://img.shields.io/discord/689805612053168129?color=7289da&logo=Discord&label=Discord%20chat)](https://discord.gg/yTJKAma)
5+
[![Discourse topics](https://img.shields.io/discourse/topics?color=yellow&logo=Discourse&server=https%3A%2F%2Fdiscuss.terminusdb.com%2F)](https://discuss.terminusdb.com/)
6+
[![Follow on Twitter](https://img.shields.io/twitter/follow/terminusdb?color=skyblue&label=Follow%20on%20Twitter&logo=twitter&style=flat)](https://twitter.com/TerminusDB)
7+
8+
**Development status ⚙️**
9+
10+
[![build status](https://api.travis-ci.com/terminusdb/terminusdb-client.svg?branch=main)](https://travis-ci.com/terminusdb/terminusdb-client)
411
[![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)
512

13+
**NPM Package status 📦**
14+
15+
[![npm version shields.io](https://img.shields.io/npm/v/@terminusdb/terminusdb-client?logo=npm)](https://www.npmjs.com/package/@terminusdb/terminusdb-client)
16+
[![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)
17+
618
Promise based terminus client for the browser and node.js
719

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

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

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

133145
## API
134146

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

137149
## Report Issues
138150

139151
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.
140152

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

143155
## Contribute
144156

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

151163
The APACHE 2.0 License
152164

153-
Copyright (c) 2019
165+
Copyright (c) 2019

docs/_sidebar.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- [user](api/woqlClient.js?id=user)
2323
- [userOrganization](api/woqlClient.js?id=userOrganization)
2424
- [databases](api/woqlClient.js?id=databases)
25+
- [userOrganizations](api/woqlClient.js?id=userOrganizations)
2526
- [databaseInfo](api/woqlClient.js?id=databaseInfo)
2627
- [db](api/woqlClient.js?id=db)
2728
- [setSystemDb](api/woqlClient.js?id=setSystemDb)
@@ -152,7 +153,7 @@
152153
- [commits](api/woqlLibrary.js?id=commits)
153154
- [previousCommits](api/woqlLibrary.js?id=previousCommits)
154155
- [first_commit](api/woqlLibrary.js?id=first_commit)
155-
- [TypeDef](api/typedef.js?id=Typedefs)
156+
- [TypeDef](api/typedef.js?id=TypeDef)
156157
- [DocParamsGet](api/typedef.js?id=DocParamsGet)
157158
- [DocParamsPost](api/typedef.js?id=DocParamsPost)
158159
- [DocParamsPut](api/typedef.js?id=DocParamsPut)

docs/api/typedef.js.md

Lines changed: 67 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,70 @@
1-
## Typedefs
2-
## DocParamsGet
3-
#### DocParamsGet : <code>Object</code>
1+
2+
## TypeDef
3+
#### TypeDef
4+
Type definations
5+
6+
7+
### DocParamsGet
8+
#### DocParamsGet: ` Object`
49
the GET document interface query parameters
510

611
**Properties**
712

8-
| Name | Type | Default | Description |
9-
| --- | --- | --- | --- |
10-
| [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. |
11-
| [type] | <code>string</code> | | only documents of the given type are returned. |
12-
| [id] | <code>string</code> | | only the document with the given ID is returned. |
13-
| [prefixed] | <code>boolean</code> | <code>true</code> | return IRIs using a prefixed notation wherever possible. If false, full IRIs are used. |
14-
| [minimized] | <code>boolean</code> | <code>false</code> | return the documents with very little whitespace. Each json document will be on its own line. |
15-
| [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. |
16-
| [skip] | <code>number</code> | <code>0</code> | How many results to skip |
17-
| [count] | <code>number</code> | | count - How many results to return. If this option is absent, all results are returned. |
18-
| [as_list] | <code>boolean</code> | <code>false</code> | If true, don't return a stream of json objects, but a json list. |
19-
| [graph_type] | <code>string</code> | | instance|schema default value is instance |
20-
21-
22-
## DocParamsPost
23-
#### DocParamsPost : <code>Object</code>
13+
| Name | Type | Description |
14+
| --- | --- | --- |
15+
| [graph_type] | <code>GraphType</code> | instance|schema, default value is instance. Used to switch between getting documents from the instance or the schema graph. |
16+
| [type] | <code>string</code> | only documents of the given type are returned. |
17+
| [id] | <code>string</code> | only the document with the given ID is returned. |
18+
| [prefixed] | <code>boolean</code> | default is true, return IRIs using a prefixed notation wherever possible. If false, full IRIs are used. |
19+
| [minimized] | <code>boolean</code> | default is false, return the documents with very little whitespace. Each json document will be on its own line. |
20+
| [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. |
21+
| [skip] | <code>number</code> | default is 0, How many results to skip |
22+
| [count] | <code>number</code> | count - How many results to return. If this option is absent, all results are returned. |
23+
| [as_list] | <code>boolean</code> | default is false, If true, don't return a stream of json objects, but a json list. |
24+
| [graph_type] | <code>string</code> | instance|schema default value is instance |
25+
26+
27+
### DocParamsPost
28+
#### DocParamsPost: ` Object`
2429
the POST document interface query parameters
2530

2631
**Properties**
2732

28-
| Name | Type | Default | Description |
29-
| --- | --- | --- | --- |
30-
| [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. |
31-
| [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. |
33+
| Name | Type | Description |
34+
| --- | --- | --- |
35+
| [graph_type] | <code>GraphType</code> | default is instance instance|schema Used to switch between getting documents from the instance or the schema graph. |
36+
| [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. |
3237

3338

34-
## DocParamsPut
35-
#### DocParamsPut : <code>Object</code>
39+
### DocParamsPut
40+
#### DocParamsPut: ` Object`
3641
the PUT document interface query parameters
3742

3843
**Properties**
3944

40-
| Name | Type | Default | Description |
41-
| --- | --- | --- | --- |
42-
| [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. |
45+
| Name | Type | Description |
46+
| --- | --- | --- |
47+
| [graph_type] | <code>GraphType</code> | default is instance, instance|schema Used to switch between getting documents from the instance or the schema graph. |
4348

4449

45-
## DocParamsDelete
46-
#### DocParamsDelete : <code>Object</code>
50+
### DocParamsDelete
51+
#### DocParamsDelete: ` Object`
4752
the DELETE document interface query parameters
4853

4954
**Properties**
5055

51-
| Name | Type | Default | Description |
52-
| --- | --- | --- | --- |
53-
| [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. |
54-
| id | <code>string</code> \| <code>array</code> | | a single id or a list of ids to delete. |
55-
| [nuke] | <code>booleam</code> | <code>false</code> | If true, delete everything at this resource location (dangerous!). |
56+
| Name | Type | Description |
57+
| --- | --- | --- |
58+
| [graph_type] | <code>GraphType</code> | default is instance, instance|schema Used to switch between getting documents from the instance or the schema graph. |
59+
| id | <code>string</code> \| <code>array</code> | a single id or a list of ids to delete. |
60+
| [nuke] | <code>booleam</code> | default is false, If true, delete everything at this resource location (dangerous!). |
5661

5762

58-
## GraphRef
59-
#### GraphRef : <code>&quot;schema/main&quot;</code> \| <code>&quot;instance/main&quot;</code> \| <code>string</code>
63+
### GraphRef
64+
#### GraphRef: ` "schema/main"` | ` "instance/main" ` | ` string `
6065

61-
## DataFormatObj
62-
#### DataFormatObj : <code>Object</code>
66+
### DataFormatObj
67+
#### DataFormatObj: ` Object`
6368
(export/import)
6469

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

7277

73-
## FuntionType
74-
#### 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>
78+
### FuntionType
79+
#### FuntionType: ` "add_quad"` | ` "delete_quad" ` | ` "add_triple" ` | ` "delete_triple" ` | ` "quad" ` | ` "triple" `
7580

76-
## ResourceType
77-
#### 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>
81+
### ResourceType
82+
#### ResourceType: ` "commits"` | ` "meta" ` | ` "branch" ` | ` "ref" ` | ` "repo" ` | ` "db" `
7883

79-
## GraphType
80-
#### GraphType : <code>&quot;instance&quot;</code> \| <code>&quot;schema&quot;</code>
84+
### GraphType
85+
#### GraphType: ` "instance"` | ` "schema" `
8186

82-
## CredentialObj
83-
#### CredentialObj : <code>Object</code>
87+
### CredentialObj
88+
#### CredentialObj: ` Object`
8489
**Properties**
8590

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

9297

93-
## ActionType
94-
#### 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>
98+
### ActionType
99+
#### ActionType: ` 'graph'` | ` 'db' ` | ` 'clone' ` | ` 'triples' ` | ` 'woql' ` | ` 'fetch' ` | ` 'pull' ` | ` 'rebase' ` | ` 'branch' ` | ` 'reset' ` | ` 'push' ` | ` 'squash' `
95100

96-
## ParamsObj
97-
#### ParamsObj : <code>Object</code>
101+
### ParamsObj
102+
#### ParamsObj: ` Object`
98103
**Properties**
99104

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

112117

113-
## RolesObj
114-
#### RolesObj : <code>Object</code>
118+
### RolesObj
119+
#### RolesObj: ` Object`
115120
**Properties**
116121

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

125130

126-
## RepoType
127-
#### RepoType : <code>&quot;local&quot;</code> \| <code>&quot;remote&quot;</code>
131+
### RepoType
132+
#### RepoType: ` "local"` | ` "remote" `
128133

129-
## DbDetails
130-
#### DbDetails : <code>Object</code>
134+
### DbDetails
135+
#### DbDetails: ` Object`
131136
**Properties**
132137

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

144149

145-
## RemoteRepoDetails
146-
#### RemoteRepoDetails : <code>Object</code>
150+
### RemoteRepoDetails
151+
#### RemoteRepoDetails: ` Object`
147152
{remote: "origin", "remote_branch": "main", "author": "admin", "message": "message"}
148153

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

158163

159-
## CloneSourceDetails
160-
#### CloneSourceDetails : <code>Object</code>
164+
### CloneSourceDetails
165+
#### CloneSourceDetails: ` Object`
161166
**Properties**
162167

163168
| Name | Type | Description |

docs/api/woql.js.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,11 @@ Orders the results of the contained subquery by a precedence list of variables
988988

989989
| Param | Type | Description |
990990
| --- | --- | --- |
991-
| ...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 |
991+
| ...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 |
992992

993993
**Example**
994994
```js
995-
WOQL.order_by("v:A", "v:B asc", "v:C desc").triple("v:A", "v:B", "v:C");
995+
WOQL.order_by("v:A", ["v:B", "asc"], ["v:C", "desc"]).triple("v:A", "v:B", "v:C");
996996
```
997997

998998
### group_by

docs/api/woqlClient.js.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,21 @@ Retrieves a list of databases (id, organization, label, comment) that the curren
341341
const my_dbs = client.databases()
342342
```
343343
344+
### userOrganizations
345+
#### woqlClient.userOrganizations([orgList]) ⇒ <code>array</code>
346+
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.
347+
348+
**Returns**: <code>array</code> - the user databases list
349+
350+
| Param | Type | Description |
351+
| --- | --- | --- |
352+
| [orgList] | <code>array</code> | a list of databases the user has access to on the server, each having: |
353+
354+
**Example**
355+
```js
356+
const my_dbs = client.databases()
357+
```
358+
344359
### databaseInfo
345360
#### woqlClient.databaseInfo([dbId]) ⇒ <code>object</code>
346361
Gets the database's details
@@ -447,12 +462,7 @@ client.remoteAuth({"key":"dhfmnmjglkrelgkptohkn","type":"jwt"})
447462
#### woqlClient.author() ⇒ <code>string</code>
448463
Gets the string that will be written into the commit log for the current user
449464
450-
**Returns**: <code>string</code> - the current user
451-
452-
| Param | Type | Description |
453-
| --- | --- | --- |
454-
| [aName] | <code>string</code> | the id to write into commit logs as the author string (normally an email address) |
455-
465+
**Returns**: <code>string</code> - the current user
456466
**Example**
457467
```js
458468
client.author()

docs/api/woqlLibrary.js.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
## WOQLLibrary
3-
#### WOQLLibrary()
3+
#### WOQLLibrary
4+
**License**: Apache Version 2
5+
6+
#### new WOQLLibrary()
47
Library Functions to manage the commits graph
58

69
**Example**

docs/createDocs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ function createFile(filePath, options, outputDir) {
6969
}
7070
////([\w-]+)(.js)/
7171
function getFileName(filePath) {
72+
73+
if(filePath === '_sidebar.js') {
74+
return '_sidebar';
75+
}
7276
const regEx = /[\w-]+\.js/;
7377
return filePath.match(regEx)[0]
7478
}

0 commit comments

Comments
 (0)