Skip to content

Commit 31d964f

Browse files
Kitty JoseKitty Jose
authored andcommitted
2 parents e7079f3 + 9fb4ab4 commit 31d964f

30 files changed

+1739
-2162
lines changed

.babelrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"presets": ["@babel/preset-env"],
3-
"plugins": ["@babel/plugin-transform-regenerator",
4-
"@babel/plugin-transform-runtime"]
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
["@babel/preset-env", {"corejs": "3.25", "useBuiltIns": "entry"}]
5+
]
56
}

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ package-lock.json
88
.nyc_output
99
test/
1010
tutorial/
11+
local_test/

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
with:
2222
source_folder: 'docs/api/.'
2323
destination_repo: 'terminusdb/terminusdb-docs'
24-
destination_folder: 'index/terminusx-db/reference-guides/javascript-client-reference'
24+
destination_folder: 'guides/reference-guides/javascript-client-reference'
2525
destination_base_branch: 'main'
2626
destination_head_branch: ${{ env.BRANCH_NAME }}
2727
user_email: 'neel@terminusdb.com'
2828
user_name: 'Neelterminusdb'
29-
pull_request_reviewers: 'mark-terminusdb'
29+
pull_request_reviewers: 'mark-terminusdb'

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ graph all through a simple document API.
2222
[terminusdb-docs]: https://terminusdb.com/docs/
2323
[terminusdb-repo]: https://github.com/terminusdb/terminusdb
2424

25-
**TerminusX** is a self-service data platform that allows you to build, deploy,
26-
execute, monitor, and share versioned data products. It is built on TerminusDB.
27-
TerminusX is in public beta and you can [sign up now][dashboard].
25+
**TerminusX** TerminusX is TerminusDB as a service. SOC 2 certified hosting. Build your beta and get to market fast. Scale up and deploy your own instance. [Sign up now][dashboard].
2826

2927
[dashboard]: https://dashboard.terminusdb.com/
3028

@@ -71,7 +69,7 @@ it to your sources, and use that in the `<script>` instead.
7169
This example creates a simple dataProduct, starting to create a database model the schema
7270
and insert a simple document
7371

74-
For the [full Documentation][terminusdb-client-js-docs]
72+
For the [full Documentation](https://terminusdb.com/docs/guides/reference-guides/javascript-client-reference)
7573

7674
```javascript
7775
const TerminusClient = require("@terminusdb/terminusdb-client");
@@ -100,7 +98,7 @@ const bankerSchema = [
10098
"@type":"Class",
10199
"@id":"Person",
102100
"@key":{
103-
"@type":"Hash",
101+
"@type":"Lexical",
104102
"@fields":[
105103
"name"
106104
]

RELEASE_NOTES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# TerminusDB Client v10.0.19
2+
3+
## New 🚀
4+
5+
* Add getOrganization in AccessControl class
6+
* Add hasDatabase head api call in WOQL-Client
7+
* Add Woql.Vars in WOQL class
8+
9+
## Fixes 🛠
10+
11+
* Remove core-js@2
12+
* Documentation fixes
13+
* Fix update_triple in woql
14+
* Fix types declaration
15+
116
# TerminusDB Client v10.0.12
217

318
## New 🚀

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const bankerSchema = [
100100
"@type":"Class",
101101
"@id":"Person",
102102
"@key":{
103-
"@type":"Hash",
103+
"@type":"Lexical",
104104
"@fields":[
105105
"name"
106106
]

docs/_sidebar.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@
6060
- [getPrefixes](api/woqlClient.js?id=getPrefixes)
6161
- [getUserOrganizations](api/woqlClient.js?id=getUserOrganizations)
6262
- [userOrganizations](api/woqlClient.js?id=userOrganizations)
63-
- [getDiff](api/woqlClient.js?id=getDiff)
63+
- [getJSONDiff](api/woqlClient.js?id=getJSONDiff)
6464
- [getVersionObjectDiff](api/woqlClient.js?id=getVersionObjectDiff)
6565
- [getVersionDiff](api/woqlClient.js?id=getVersionDiff)
66+
- [apply](api/woqlClient.js?id=apply)
6667
- [patch](api/woqlClient.js?id=patch)
6768
- [WOQL](api/woql.js?id=WOQL)
6869
- [using](api/woql.js?id=using)
@@ -169,6 +170,7 @@
169170
- [setApiToken](api/accessControl.js?id=setApiToken)
170171
- [setApiKey](api/accessControl.js?id=setApiKey)
171172
- [getAPIUrl](api/accessControl.js?id=getAPIUrl)
173+
- [customHeaders](api/accessControl.js?id=customHeaders)
172174
- [getAllOrganizations](api/accessControl.js?id=getAllOrganizations)
173175
- [createOrganization](api/accessControl.js?id=createOrganization)
174176
- [deleteOrganization](api/accessControl.js?id=deleteOrganization)

docs/api/accesscontrol.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ add extra headers to your request
104104
| customHeaders | <code>object</code> |
105105

106106

107+
## getOrganization
108+
##### accessControl.getOrganization(organization) ⇒ <code>object</code>
109+
-- TerminusDB API ---
110+
Get an organization from the TerminusDB API.
111+
112+
**Returns**: <code>object</code> - - organization
113+
114+
| Param | Type | Description |
115+
| --- | --- | --- |
116+
| organization | <code>string</code> | The organization |
117+
118+
107119
## getAllOrganizations
108120
##### accessControl.getAllOrganizations() ⇒ <code>Promise</code>
109121
-- TerminusDB API ---
@@ -242,25 +254,33 @@ accessControl.deleteUser(userId).then(result=>{
242254
```
243255

244256
## manageCapability
245-
##### accessControl.manageCapability(userId, resourceId, rolesArr, operation) ⇒ <code>Promise</code>
257+
##### accessControl.manageCapability(userName, resourceName, rolesArr, operation, resourceType) ⇒ <code>Promise</code>
246258
-- TerminusdDB API ---
247259
Grant/Revoke Capability
248260

249261
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
250262

251263
| Param | Type | Description |
252264
| --- | --- | --- |
253-
| userId | <code>string</code> | the document user id |
254-
| resourceId | <code>string</code> | the resource id (database or team) |
255-
| rolesArr | <code>array</code> | the roles list |
265+
| userName | <code>string</code> | the document user id |
266+
| resourceName | <code>string</code> | the name of a (database or team) |
267+
| rolesArr | <code>array</code> | the roles name list |
256268
| operation | <code>typedef.CapabilityCommand</code> | grant/revoke operation |
269+
| resourceType | <code>typedef.ResourceType</code> | the resource type (database or organization) |
257270

258271
**Example**
259272
```javascript
260-
{ "operation" : "grant",
261-
"scope" : "Organization/myteam",
262-
"user" : "User/myUser",
263-
"roles" : ["Role/reader"] }
273+
//we add an user to an organization and manage users' access
274+
//the user myUser can access the Organization and all the database under the organization with "reader" Role
275+
client.manageCapability(myUser,myteam,[reader],"grant","organization").then(result=>{
276+
consol.log(result)
277+
})
278+
279+
//the user myUser can access the database db__001 under the organization myteam
280+
//with "writer" Role
281+
client.manageCapability(myUser,myteam/db__001,[writer],"grant","database").then(result=>{
282+
consol.log(result)
283+
})
264284
```
265285

266286
## getAccessRoles

docs/api/typedef.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ the POST document interface query parameters
3232

3333
| Name | Type | Description |
3434
| --- | --- | --- |
35+
| [raw_json] | <code>boolean</code> | default is false, If true, the input documents are treated as raw JSON, inserted as type sys:JSONDocument and are not subject to schema restrictions. |
3536
| [graph_type] | <code>GraphType</code> | default is instance instance|schema Used to switch between getting documents from the instance or the schema graph. |
3637
| [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. |
3738

@@ -44,6 +45,7 @@ the PUT document interface query parameters
4445

4546
| Name | Type | Description |
4647
| --- | --- | --- |
48+
| [raw_json] | <code>boolean</code> | default is false, If true, the input documents are treated as raw JSON, inserted as type sys:JSONDocument and are not subject to schema restrictions. |
4749
| [graph_type] | <code>GraphType</code> | default is instance, instance|schema Used to switch between getting documents from the instance or the schema graph. |
4850

4951

@@ -90,7 +92,7 @@ the DELETE document interface query parameters
9092

9193
| Name | Type | Description |
9294
| --- | --- | --- |
93-
| type | <code>&#x27;basic&#x27;</code> \| <code>&#x27;jwt&#x27;</code> | the authorization type of an TerminusDB connection |
95+
| type | <code>&#x27;basic&#x27;</code> \| <code>&#x27;jwt&#x27;</code> \| <code>&#x27;apikey&#x27;</code> | the authorization type of an TerminusDB connection |
9496
| [user] | <code>string</code> \| <code>boolean</code> | the user id | I don't need the user with the jwt token |
9597
| key | <code>string</code> | the connection key |
9698

@@ -129,6 +131,9 @@ the DELETE document interface query parameters
129131
| [invitation] | <code>string</code> | - |
130132

131133

134+
## ResourceType
135+
##### ResourceType: ` "database"` | ` "organization" `
136+
132137
## RepoType
133138
##### RepoType: ` "local"` | ` "remote" `
134139

@@ -138,13 +143,9 @@ the DELETE document interface query parameters
138143

139144
| Name | Type | Description |
140145
| --- | --- | --- |
141-
| [organization] | <code>string</code> | the db organization id |
142-
| id | <code>string</code> | The database identification name |
143146
| label | <code>string</code> | "Textual DB Name" |
144147
| [comment] | <code>string</code> | "Text description of DB" |
145148
| [public] | <code>boolean</code> | |
146-
| [icon] | <code>string</code> | The database's icon |
147-
| [prefixes] | <code>object</code> | {scm: "http://url.to.use/for/scm", doc: "http://url.to.use/for/doc"} |
148149
| [schema] | <code>boolean</code> | if set to true, a schema graph will be created |
149150

150151

docs/api/woql.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -387,22 +387,6 @@ Identifies a remote resource by URL and specifies the format of the resource thr
387387
remote({url:"http://url.of.resource"}, {type: "csv"})
388388
```
389389

390-
## file
391-
##### WOQL.file(url, [formatObj]) ⇒ <code>WOQLQuery</code>
392-
Identifies a file resource as a path on the server and specifies the format through the options
393-
394-
**Returns**: <code>WOQLQuery</code> - A WOQLQuery which contains the file resource identifier
395-
396-
| Param | Type | Description |
397-
| --- | --- | --- |
398-
| url | <code>object</code> | The Path on the server at which the file resource can be accessed |
399-
| [formatObj] | <code>typedef.DataFormatObj</code> | imput options |
400-
401-
**Example**
402-
```javascript
403-
file("/path/to/file", {type: 'turtle'} )
404-
```
405-
406390
## post
407391
##### WOQL.post(url, [formatObj], [source]) ⇒ <code>WOQLQuery</code>
408392
Identifies a resource as a local path on the client, to be sent to the server through a
@@ -1429,6 +1413,20 @@ Gets/Sets woqlClient
14291413
| client | <code>WOQLClient</code> |
14301414

14311415

1416+
## Vars
1417+
##### WOQL.Vars(...varNames) ⇒
1418+
**Returns**: object
1419+
1420+
| Param | Type |
1421+
| --- | --- |
1422+
| ...varNames | <code>string</code> |
1423+
1424+
**Example**
1425+
```javascript
1426+
const v = WOQL.Vars('var01', 'var02', 'var03');
1427+
triple(v.var01, v.var02, v.var03)
1428+
```
1429+
14321430
## emerge
14331431
##### WOQL.emerge(auto_eval)
14341432
query module

0 commit comments

Comments
 (0)