Skip to content

Commit 1e3d865

Browse files
Merge pull request #253 from terminusdb/fix_typedef
Fix typedef
2 parents ef5a7d8 + 7b7cdcc commit 1e3d865

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

docs/api/typedef.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# TypeDef
33
##### TypeDef
4-
Type definations
4+
Type definitions
55

66

77
## DocParamsGet
@@ -150,6 +150,20 @@ the DELETE document interface query parameters
150150
| [schema] | <code>boolean</code> | if set to true, a schema graph will be created |
151151

152152

153+
## DbDoc
154+
##### DbDoc: ` Object`
155+
**Properties**
156+
157+
| Name | Type | Description |
158+
| --- | --- | --- |
159+
| id | <code>string</code> | "Database ID" |
160+
| [label] | <code>string</code> | "Textual DB Name" |
161+
| [comment] | <code>string</code> | "Text description of DB" |
162+
| [organization] | <code>string</code> | "Organization to which the db belongs" |
163+
| [public] | <code>boolean</code> | - |
164+
| [schema] | <code>boolean</code> | if set to true, a schema graph will be created |
165+
166+
153167
## RemoteRepoDetails
154168
##### RemoteRepoDetails: ` Object`
155169
{remote: "origin", "remote_branch": "main", "author":

docs/api/woqlclient.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,16 +550,14 @@ const branch_resource = client.resource("branch")
550550
```
551551
552552
## updateDatabase
553-
##### woqlClient.updateDatabase(dbId, dbDetails, [orgId]) ⇒ <code>Promise</code>
553+
##### woqlClient.updateDatabase(dbDoc) ⇒ <code>Promise</code>
554554
Update a database in TerminusDB server
555555
556556
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
557557
558558
| Param | Type | Description |
559559
| --- | --- | --- |
560-
| dbId | <code>string</code> | The id of the database to be updated |
561-
| dbDetails | <code>typedef.DbDetails</code> | object containing details about the database to be updated |
562-
| [orgId] | <code>string</code> | optional organization id - if absent default local organization id is used |
560+
| dbDoc | <code>typedef.DbDoc</code> | object containing details about the database to be updated |
563561
564562
**Example**
565563
```javascript

lib/typedef.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @module TypeDef
3-
* @description Type definations
3+
* @description Type definitions
44
* */
55
/* eslint-disable no-unused-vars */
66
const Utils = require('./utils');
@@ -132,6 +132,16 @@ const { ACTIONS } = Utils.ACTIONS;
132132
* @property {boolean} [schema] - if set to true, a schema graph will be created
133133
*/
134134

135+
/**
136+
* @typedef {Object} DbDoc
137+
* @property {string} id - "Database ID"
138+
* @property {string} [label] - "Textual DB Name"
139+
* @property {string} [comment] - "Text description of DB"
140+
* @property {string} [organization] - "Organization to which the db belongs"
141+
* @property {boolean} [public] -
142+
* @property {boolean} [schema] - if set to true, a schema graph will be created
143+
*/
144+
135145
/**
136146
*@typedef {Object} RemoteRepoDetails - {remote: "origin", "remote_branch": "main", "author":
137147
"admin","message": "message"}

lib/woqlClient.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,7 @@ WOQLClient.prototype.createDatabase = function (dbId, dbDetails, orgId) {
460460

461461
/**
462462
* Update a database in TerminusDB server
463-
* @param {string} dbId - The id of the database to be updated
464-
* @param {typedef.DbDetails} dbDetails - object containing details about the database to be updated
465-
* @param {string} [orgId] - optional organization id - if absent default local organization
466-
* id is used
463+
* @param {typedef.DbDoc} dbDoc - object containing details about the database to be updated
467464
* @returns {Promise} A promise that returns the call response object, or an Error if rejected.
468465
* @example
469466
* client.updateDatabase({id: "mydb", label: "My Database", comment: "Testing"})

0 commit comments

Comments
 (0)