@@ -21,22 +21,25 @@ const { default: axios } = require('axios')
21
21
* @example
22
22
* //to connect with your local terminusDB
23
23
* const client = new TerminusClient.WOQLClient(SERVER_URL,{user:"admin",key:"myKey"})
24
- * await client.connect()
25
- * client.db("test")
26
- * client.checkout("dev")
27
- * const schema = await client.getSchema()
24
+ * async function getSchema() {
25
+ * await client.connect()
26
+ * client.db("test")
27
+ * client.checkout("dev")
28
+ * const schema = await client.getSchema()
29
+ * }
28
30
* //The client has an internal state which defines what
29
31
* //organization / database / repository / branch / ref it is currently attached to
30
32
*
31
33
* //to connect with your TerminusDB Cloud Instance
32
34
* const client = new TerminusClient.WOQLClient(SERVER_URL,{user:"myemail@something .com",
33
- * jwt:"MY_ACCESS_TOKEN",
34
35
* organization:'mycloudTeam'})
35
- * await client.connect()
36
- * client.db("test")
37
- * client.checkout("dev")
38
- * const schema = await client.getSchema()
39
- *
36
+ * client.setApiKey(MY_ACCESS_TOKEN)
37
+ * async function getSchema() {
38
+ * await client.connect()
39
+ * client.db("test")
40
+ * client.checkout("dev")
41
+ * const schema = await client.getSchema()
42
+ * }
40
43
*/
41
44
42
45
function WOQLClient ( serverUrl , params ) {
@@ -47,7 +50,7 @@ function WOQLClient(serverUrl, params) {
47
50
48
51
49
52
/**
50
- *
53
+ * set the api key to access the cloud resources
51
54
* @param {string } accessToken
52
55
*/
53
56
WOQLClient . prototype . setApiKey = function ( accessToken ) {
@@ -65,15 +68,6 @@ WOQLClient.prototype.customHeaders = function(customHeaders) {
65
68
else return this . _customHeaders
66
69
}
67
70
68
- /**
69
- * set the api access token to connect to TerminusX Cloud
70
- * @param {string } accessToken
71
- */
72
-
73
- WOQLClient . prototype . setApiKey = function ( accessToken ) {
74
- this . localAuth ( { type : "jwt" , key : accessToken } )
75
- }
76
-
77
71
WOQLClient . CONST = CONST
78
72
79
73
/**
0 commit comments