Skip to content

Commit bc8c95c

Browse files
committed
review document
1 parent b8a6917 commit bc8c95c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

lib/woqlClient.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ WOQLClient.prototype.databaseInfo = function(dbId) {
165165
WOQLClient.prototype.db = function(dbId) {
166166
if (typeof dbId !== 'undefined') {
167167
this.connectionConfig.setDB(dbId)
168-
//this.checkout("_commits")
169168
}
170169
return this.connectionConfig.db()
171170
}
@@ -875,6 +874,7 @@ WOQLClient.prototype.dispatch = async function(action, apiUrl, payload) {
875874
const param = this.connectionConfig.tokenParameter
876875
await axios.post(param.url,param.options).then(result=>result.data).then(data=>{
877876
if(data.access_token){
877+
console.log("ACCESS_TOKEN",data.access_token)
878878
this.localAuth({"key":data.access_token,"type":"jwt"})
879879
}
880880
})
@@ -1291,6 +1291,21 @@ WOQLClient.prototype.schema = function(type,dbId){
12911291
return this.dispatch(CONST.GET, this.connectionConfig.jsonSchemaURL(params))
12921292
}
12931293

1294+
WOQLClient.prototype.classes = function(dbId){
1295+
const params = {'graph_type':"schema","as_list":true,"type":"sys:Class"}
1296+
return this.getDocument(params,dbId)
1297+
}
1298+
1299+
WOQLClient.prototype.getDocuments = async function(dbId){
1300+
const params = {'graph_type':"schema","as_list":true,"type":"sys:Class"}
1301+
const result = await this.getDocument(params,dbId)
1302+
let documents=[]
1303+
if(result){
1304+
documents = result.filter(item => !item['@subdocument']);
1305+
}
1306+
return documents
1307+
}
1308+
12941309
WOQLClient.prototype.branches = async function(dbId){
12951310
const params={type:'Branch','as_list':true}
12961311
const branch = this.checkout()

0 commit comments

Comments
 (0)