Skip to content

Commit c324df4

Browse files
Merge pull request #114 from terminusdb/depricConnect
Deprecated connect function
2 parents 0a7bdae + 4544a2b commit c324df4

File tree

5 files changed

+37
-26
lines changed

5 files changed

+37
-26
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const bankerSchema = [
110110

111111
async function createDataProduct(){
112112
try{
113-
await client.connect()
113+
114114
await client.createDatabase("banker", {label: "Banker Account",
115115
comment: "Testing", schema: true})
116116
//add the schema documents

docs/README.md

+26-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
TerminusDB Client Javascript
2-
==========================
1+
[![TerminusDB JavaScript Client](https://assets.terminusdb.com/readmes/terminusdb-client-js/header.gif)][terminusdb-client-js-docs]
32

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)
3+
[terminusdb-client-js-docs]: https://terminusdb.github.io/terminusdb-client-js/
74

8-
**Development status ⚙️**
5+
---
96

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

13-
**NPM Package status 📦**
11+
[![npm version](https://img.shields.io/npm/v/@terminusdb/terminusdb-client?logo=npm)](https://www.npmjs.com/package/@terminusdb/terminusdb-client)
12+
[![npm downloads](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)
1413

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)
14+
> This repository is for the JavaScript client for TerminusDB and TerminusX. The
15+
> JavaScript client runs in the browser and on Node.js.
1716
18-
Promise based terminus client for the browser and node.js
17+
[**TerminusDB**][terminusdb] is an [open-source][terminusdb-repo] graph database
18+
and document store. It allows you to link JSON documents in a powerful knowledge
19+
graph all through a simple document API.
20+
21+
[terminusdb]: https://terminusdb.com/
22+
[terminusdb-docs]: https://terminusdb.com/docs/
23+
[terminusdb-repo]: https://github.com/terminusdb/terminusdb
24+
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].
28+
29+
[dashboard]: https://dashboard.terminusdb.com/
1930

2031
## Requirements
2132

@@ -59,7 +70,7 @@ Download the terminusdb-client.min.js file from the /dist directory and save it
5970
This example creates a simple dataProduct, starting to create a database model the schema
6071
and insert a simple document
6172

62-
For the [full Documentation](https://terminusdb.github.io/terminusdb-client-js/)
73+
For the [full Documentation][terminusdb-client-js-docs]
6374

6475
```javascript
6576
const TerminusClient = require("@terminusdb/terminusdb-client");
@@ -99,7 +110,7 @@ const bankerSchema = [
99110

100111
async function createDataProduct(){
101112
try{
102-
await client.connect()
113+
103114
await client.createDatabase("banker", {label: "Banker Account",
104115
comment: "Testing", schema: true})
105116
//add the schema documents
@@ -144,7 +155,7 @@ const client = new TerminusClient.WOQLClient("http://127.0.0.1:6363/", {
144155

145156
## API
146157

147-
The API of the most recent release is documented at: <https://terminusdb.com/docs/v10.0/#/reference/reference-api>
158+
The TerminusDB API can be found at the [TerminusDB Documentation][terminusdb-docs].
148159

149160
## Report Issues
150161

docs/_sidebar.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!-- docs/_sidebar.md -->
22
- [WOQLClient](api/woqlClient.js?id=WOQLClient)
33
- [TerminusDB Client API](api/woqlClient.js?id=terminusdb-client-api)
4-
- [Connect](api/woqlClient.js?id=connect)
54
- [Create Database](api/woqlClient.js?id=create-database)
65
- [Delete Database](api/woqlClient.js?id=delete-database)
76
- [Get Triples](api/woqlClient.js?id=get-triples)

docs/api/woqlClient.js.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ For situations where you want to communicate with a TerminusDB server API, the W
2020
//to connect with your local terminusDB
2121
const client = new TerminusClient.WOQLClient(SERVER_URL,{user:"admin",key:"myKey"})
2222
async function getSchema() {
23-
await client.connect()
2423
client.db("test")
2524
client.checkout("dev")
2625
const schema = await client.getSchema()
@@ -34,7 +33,6 @@ const client = new TerminusClient.WOQLClient('SERVER_CLOUD_URL/mycloudTeam',
3433

3534
client.setApiKey(MY_ACCESS_TOKEN)
3635
async function getSchema() {
37-
await client.connect()
3836
client.db("test")
3937
client.checkout("dev")
4038
const schema = await client.getSchema()
@@ -44,7 +42,9 @@ async function getSchema() {
4442
### TerminusDB Client API
4543

4644
### Connect
47-
#### woqlClient.connect([params]) ⇒ <code>Promise</code>
45+
#### ~~woqlClient.connect([params]) ⇒ <code>Promise</code>~~
46+
***Deprecated***
47+
4848
Connect to a Terminus server at the given URI with an API key
4949
Stores the system:ServerCapability document returned
5050
in the connection register which stores, the url, key, capabilities,
@@ -328,7 +328,7 @@ user has fields: [id, name, notes, author]
328328
329329
### databases
330330
#### woqlClient.databases([dbList]) ⇒ <code>array</code>
331-
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.
331+
Retrieves a list of databases (id, organization, label, comment) that the current user has access to on the server.
332332
333333
**Returns**: <code>array</code> - the user databases list
334334
@@ -343,7 +343,7 @@ const my_dbs = client.databases()
343343
344344
### userOrganizations
345345
#### 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.
346+
Retrieves a list of databases (id, organization, label, comment) that the current user has access to on the server.
347347
348348
**Returns**: <code>array</code> - the user databases list
349349

lib/woqlClient.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const { default: axios } = require('axios')
2222
* //to connect with your local terminusDB
2323
* const client = new TerminusClient.WOQLClient(SERVER_URL,{user:"admin",key:"myKey"})
2424
* async function getSchema() {
25-
* await client.connect()
2625
* client.db("test")
2726
* client.checkout("dev")
2827
* const schema = await client.getSchema()
@@ -36,7 +35,6 @@ const { default: axios } = require('axios')
3635
*
3736
* client.setApiKey(MY_ACCESS_TOKEN)
3837
* async function getSchema() {
39-
* await client.connect()
4038
* client.db("test")
4139
* client.checkout("dev")
4240
* const schema = await client.getSchema()
@@ -149,7 +147,7 @@ WOQLClient.prototype.userOrganization = function() {
149147

150148

151149
/**
152-
* 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.
150+
* Retrieves a list of databases (id, organization, label, comment) that the current user has access to on the server.
153151
* @param {array} [dbList] a list of databases the user has access to on the server, each having:
154152
* @returns {array} the user databases list
155153
* @example
@@ -161,7 +159,7 @@ WOQLClient.prototype.databases = function(dbList) {
161159
}
162160

163161
/**
164-
* 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.
162+
* Retrieves a list of databases (id, organization, label, comment) that the current user has access to on the server.
165163
* @param {array} [orgList] a list of databases the user has access to on the server, each having:
166164
* @returns {array} the user databases list
167165
* @example
@@ -346,6 +344,9 @@ WOQLClient.prototype.resource = function(resourceType, resourceId) {
346344
* and database meta-data for the connected server
347345
* this.connectionConfig.server will be used if present,
348346
* or the promise will be rejected.
347+
*
348+
* @deprecated
349+
*
349350
* @param {typedef.ParamsObj} [params] - TerminusDB Server connection parameters
350351
* @returns {Promise} the connection capabilities response object or an error object
351352
* @example

0 commit comments

Comments
 (0)