Skip to content

Commit 85a0a9a

Browse files
Merge pull request #236 from terminusdb/coveralls-next
new release
2 parents 137a146 + 00dd787 commit 85a0a9a

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

docs/api/accesscontrol.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,25 @@ exists and 404: if the organization does not exist
385385
| orgName | <code>string</code> | The organization name to check if exists. |
386386

387387

388+
## createOrganizationRemote
389+
##### accessControl.createOrganizationRemote(orgName) ⇒ <code>Promise</code>
390+
-- TerminusX API ---
391+
IMPORTANT This does not work with the API-TOKEN.
392+
Create an organization
393+
394+
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
395+
396+
| Param | Type | Description |
397+
| --- | --- | --- |
398+
| orgName | <code>string</code> | The organization name to create |
399+
400+
**Example**
401+
```javascript
402+
accessControl.createOrganization("my_org_name").then(result=>{
403+
console.log(result)
404+
})
405+
```
406+
388407
## getPendingOrgInvites
389408
##### accessControl.getPendingOrgInvites([orgName]) ⇒ <code>Promise</code>
390409
-- TerminusX API ---

lib/accessControl.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,23 @@ AccessControl.prototype.ifOrganizationExists = function (orgName) {
460460
return this.dispatch(`${this.baseURL}/private/organizations/${UTILS.encodeURISegment(orgName)}`, CONST.HEAD);
461461
};
462462

463+
/**
464+
* -- TerminusX API ---
465+
* IMPORTANT This does not work with the API-TOKEN.
466+
* Create an organization
467+
* @param {string} orgName - The organization name to create
468+
* @return {Promise} A promise that returns the call response object, or an Error if rejected.
469+
* @example
470+
* accessControl.createOrganization("my_org_name").then(result=>{
471+
* console.log(result)
472+
* })
473+
*/
474+
AccessControl.prototype.createOrganizationRemote = function (orgName) {
475+
// maybe we have to review this
476+
const payload = { organization: orgName };
477+
return this.dispatch(`${this.baseURL}/private/organizations`, CONST.POST, payload);
478+
};
479+
463480
/**
464481
* -- TerminusX API ---
465482
* Get the pending invitations list.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@terminusdb/terminusdb-client",
3-
"version": "10.0.20",
3+
"version": "10.0.21",
44
"description": "TerminusDB client library",
55
"main": "index.js",
66
"types": "./dist/typescript/index.d.ts",

0 commit comments

Comments
 (0)