@@ -166,7 +166,9 @@ WOQLClient.prototype.db = function(dbId) {
166
166
if ( typeof dbId !== 'undefined' ) {
167
167
this . connectionConfig . setDB ( dbId )
168
168
}
169
- return this . connectionConfig . db ( )
169
+ return this . connectionConfig . dbid
170
+
171
+ //this.connectionConfig.db()
170
172
}
171
173
172
174
/**
@@ -859,7 +861,7 @@ WOQLClient.prototype.clonedb = function(cloneSource, newDbId, orgId) {
859
861
* @property {object } [payload] - the post body
860
862
* @returns {Promise } A promise that returns the call response object, or an Error if rejected.
861
863
*/
862
- WOQLClient . prototype . dispatch = async function ( action , apiUrl , payload ) {
864
+ WOQLClient . prototype . dispatch = function ( action , apiUrl , payload ) {
863
865
if ( ! apiUrl ) {
864
866
return Promise . reject (
865
867
new Error (
@@ -870,15 +872,15 @@ WOQLClient.prototype.dispatch = async function(action, apiUrl, payload) {
870
872
) ,
871
873
)
872
874
} //I have to do a call to get the jwt token
873
- if ( this . connectionConfig . tokenParameter ) {
875
+ /* if(this.connectionConfig.tokenParameter){
874
876
const param = this.connectionConfig.tokenParameter
875
877
await axios.post(param.url,param.options).then(result=>result.data).then(data=>{
876
878
if(data.access_token){
877
879
console.log("ACCESS_TOKEN",data.access_token)
878
880
this.localAuth({"key":data.access_token,"type":"jwt"})
879
881
}
880
882
})
881
- }
883
+ }*/
882
884
return DispatchRequest (
883
885
apiUrl ,
884
886
action ,
@@ -1282,7 +1284,7 @@ WOQLClient.prototype.deleteDocument = function(params,dbId,message="delete docum
1282
1284
* @returns
1283
1285
*/
1284
1286
1285
- WOQLClient . prototype . schema = function ( type , dbId ) {
1287
+ WOQLClient . prototype . getSchemaFrame = function ( type , dbId ) {
1286
1288
let params
1287
1289
if ( type ) params = { type :type }
1288
1290
if ( dbId ) {
@@ -1291,22 +1293,47 @@ WOQLClient.prototype.schema = function(type,dbId){
1291
1293
return this . dispatch ( CONST . GET , this . connectionConfig . jsonSchemaURL ( params ) )
1292
1294
}
1293
1295
1294
- WOQLClient . prototype . classes = function ( dbId ) {
1296
+ /**
1297
+ * get all the schema classes (documents,subdocuments,abstracts)
1298
+ * @param {string } [dbId]
1299
+ * @returns
1300
+ */
1301
+ WOQLClient . prototype . getClasses = function ( dbId ) {
1295
1302
const params = { 'graph_type' :"schema" , "as_list" :true , "type" :"sys:Class" }
1296
1303
return this . getDocument ( params , dbId )
1297
1304
}
1298
1305
1299
- WOQLClient . prototype . getDocuments = async function ( dbId ) {
1306
+ /**
1307
+ * get all the Enum Objects
1308
+ * @param {string } [dbId]
1309
+ * @returns
1310
+ */
1311
+ WOQLClient . prototype . getEnums = function ( dbId ) {
1312
+ const params = { 'graph_type' :"schema" , "as_list" :true , "type" :"sys:Enum" }
1313
+ return this . getDocument ( params , dbId )
1314
+ }
1315
+
1316
+ /**
1317
+ * get all the Document Classes (no abstract)
1318
+ * @param {string } [dbId]
1319
+ * @returns
1320
+ */
1321
+ /*WOQLClient.prototype.getClassDocuments = async function(dbId){
1300
1322
const params = {'graph_type':"schema","as_list":true,"type":"sys:Class"}
1301
1323
const result = await this.getDocument(params,dbId)
1302
1324
let documents=[]
1303
1325
if(result){
1304
1326
documents = result.filter(item => !item['@subdocument '] && !item['@abstract'])
1305
1327
}
1306
1328
return documents
1307
- }
1329
+ }*/
1308
1330
1309
- WOQLClient . prototype . branches = async function ( dbId ) {
1331
+ /**
1332
+ *
1333
+ * @param {* } dbId
1334
+ * @returns
1335
+ */
1336
+ /*WOQLClient.prototype.getBranches = async function(dbId){
1310
1337
const params={type:'Branch','as_list':true}
1311
1338
const branch = this.checkout()
1312
1339
const result = await this.getDocument(params,dbId,"_commits")
@@ -1319,6 +1346,6 @@ WOQLClient.prototype.branches = async function(dbId){
1319
1346
}
1320
1347
this.checkout(branch)
1321
1348
return branchesObj
1322
- }
1349
+ }*/
1323
1350
1324
1351
module . exports = WOQLClient
0 commit comments