Skip to content

Commit 451e8f0

Browse files
committed
move call from get to post - add post to woql
1 parent 7acae99 commit 451e8f0

File tree

9 files changed

+29
-88
lines changed

9 files changed

+29
-88
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ pids
1111

1212
public_pages
1313

14+
mytest
15+
1416
# Directory for instrumented libs generated by jscoverage/JSCover
17+
1518
lib-cov
1619

1720
# Coverage directory used by tools like istanbul

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ before_deploy:
3232
git push https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG HEAD:$TRAVIS_BRANCH
3333
git tag -f -a "$PACKAGE_VERSION" -m "new version $PACKAGE_VERSION"
3434
export LAST_HASH=$(git ls-remote https://github.com/$TRAVIS_REPO_SLUG $TRAVIS_BRANCH | awk '{ print $1}')
35-
echo $LAST_HASH
35+
echo $NPM_TOKEN
3636
fi
3737
3838
deploy:

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terminus-client
22
===============
33

4-
[![build status](https://api.travis-ci.org/terminusdb/terminus-client.svg?branch=master)](https://travis-ci.org/terminusdb/terminus-client)
4+
[![build status](https://api.travis-ci.com/terminusdb/terminus-client.svg?branch=master)](https://travis-ci.com/terminusdb/terminus-client)
55
[![Coverage Status](https://coveralls.io/repos/github/terminusdb/terminus-client/badge.svg?branch=master)](https://coveralls.io/repos/github/terminusdb/terminus-client/badge.svg?branch=master)
66
[![code helpers]
77

demo/multiFile/multi.js

Lines changed: 0 additions & 65 deletions
This file was deleted.

demo/multiFile/testMultiFile.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/woql.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@ WOQL.remote = function(url, opts){ return new WOQLQuery().remote(url, opts); }
240240
*/
241241
WOQL.file = function(url, opts){ return new WOQLQuery().file(url, opts); }
242242

243+
244+
/**
245+
* Provides details of a file source in a JSON format that includes a URL property
246+
* @param {object} url - file data source in a JSON format
247+
* @param {object} opts - imput options, optional
248+
* @return {object} WOQLQuery
249+
*/
250+
WOQL.post = function(url, opts){ return new WOQLQuery().post(url, opts); }
251+
252+
243253
/**
244254
* Create a list of variables for WOQL
245255
* @param vars - variables to be put in the list
@@ -705,6 +715,11 @@ WOQLQuery.prototype.remote = function(json, opts){
705715
return this;
706716
}
707717

718+
WOQLQuery.prototype.post = function(json, opts){
719+
this.cursor['post'] = (opts ? [json, opts] : [json]);
720+
return this;
721+
}
722+
708723
WOQLQuery.prototype.file = function(json, opts){
709724
this.cursor['file'] = (opts ? [json, opts] : [json]);
710725
return this;
@@ -1884,12 +1899,12 @@ WOQLQuery.prototype.execute = function(client,fileList){
18841899
this.query["@context"]["_"] = "_:";
18851900
const opts=fileList ? {fileList:fileList} : null;
18861901
if(this.contains_update){
1887-
return client.select(false, json,opts);
1888-
//return client.update(false, json);
1902+
//return client.select(false, json,opts);
1903+
return client.update(false, json,opts);
18891904
}
18901905
else {
1891-
return client.select(false, json,opts);
1892-
//return client.update(false, json);
1906+
//return client.select(false, json,opts);
1907+
return client.update(false, json,opts);
18931908
}
18941909
}
18951910

lib/woqlClient.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,14 @@ WOQLClient.prototype.select = function (qurl, woql, opts) {
316316
WOQLClient.prototype.update = function (qurl, woql, opts) {
317317
if (qurl && !this.connectionConfig.setQueryURL(qurl)) {
318318
return Promise.reject(
319-
new URIError(ErrorMessage.getInvalidURIMessage(qurl, 'Update'))
319+
new URIError(ErrorMessage.getInvalidURIMessage(qurl, 'Select'))
320320
);
321321
}
322-
//{fileName01,filePath,fileName02:filePath02....}
323322
const fileList = opts ? opts.fileList : {};
324323
let q = {'terminus:query' : JSON.stringify(woql), ...fileList};
324+
325325
q = this.addOptionsToWOQL(q, opts);
326-
return this.dispatch(this.connectionConfig.queryURL(), 'woql_update', woql);
326+
return this.dispatch(this.connectionConfig.queryURL(), CONST.WOQL_UPDATE, q);
327327
};
328328

329329
/**

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@terminusdb/terminus-client",
3-
"version": "1.1.2",
3+
"version": "1.1.1",
44
"description": "TerminusDB client library",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)