Skip to content

Commit a44a0e1

Browse files
Merge branch 'dev' of https://github.com/terminusdb/terminus-client into dev
2 parents 1361c2f + 451e8f0 commit a44a0e1

File tree

14 files changed

+133
-238
lines changed

14 files changed

+133
-238
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Logs
2+
local.txt
23
logs
34
*.log
45
npm-debug.log*
@@ -10,7 +11,10 @@ pids
1011

1112
public_pages
1213

14+
mytest
15+
1316
# Directory for instrumented libs generated by jscoverage/JSCover
17+
1418
lib-cov
1519

1620
# Coverage directory used by tools like istanbul

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ CHANGELOG.md
2626
.prettierrc
2727
.gitignore
2828
app.js
29+
30+
.demo

.travis.yml

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,65 @@
1-
#node -pe "require('./package.json').version"
2-
#before_script:
3-
# in master branch increment the version
4-
#- npm version patch
5-
# on:
6-
# branch : master
7-
#- npm install -g documentation
8-
#- npm run doc
9-
1+
before_script:
2+
- |
3+
if [[ $TRAVIS_BRANCH == 'clientBuild' && $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"* ]]; then
4+
echo "__INCREMENT_VERSION_NUMBER__"
5+
export PACKAGE_VERSION=$(npm version patch)
6+
npm install -g documentation
7+
npm run doc
8+
fi
109
1110
language: node_js
1211
sudo: required
1312
node_js:
1413
- "stable"
14+
1515
# travis call prepare
1616
# Send coverage data to Coveralls
17+
# Deploy terminusdb/terminus-client
1718
after_script:
1819
- npm run coveralls-after
1920

2021
branches:
2122
only:
22-
- dev
23-
- master
23+
- clientBuild
24+
25+
before_deploy:
26+
- |
27+
if [[ ! $TRAVIS_VAR ]]; then
28+
npm run build
29+
echo "___TRAVIS_VAR____"
30+
export TRAVIS_VAR="1.$TRAVIS_BUILD_NUMBER"
31+
git commit --amend -m "[skip travis] version changed $PACKAGE_VERSION"
32+
git push https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG HEAD:$TRAVIS_BRANCH
33+
git tag -f -a "$PACKAGE_VERSION" -m "new version $PACKAGE_VERSION"
34+
export LAST_HASH=$(git ls-remote https://github.com/$TRAVIS_REPO_SLUG $TRAVIS_BRANCH | awk '{ print $1}')
35+
echo $NPM_TOKEN
36+
fi
2437
25-
before_deploy:
26-
if ! [[ $TRAVIS_TAG ]]; then
27-
export TRAVIS_TAG="1.$TRAVIS_BUILD_NUMBER" &&
28-
npm install -g documentation &&
29-
npm version patch &&
30-
npm run doc
31-
# Set up git user name and tag this commit
32-
git config --local user.name "Francesca-Bit" &&
33-
git config --local user.email "[email protected]" &&
34-
git add package.json &&
35-
git commit -m "version changed travis_build_number $TRAVIS_TAG" &&
36-
git push origin master &&
37-
npm run git-tag;
38-
fi
3938
deploy:
40-
- provider: releases
41-
api_key: $GITHUB_TOKEN
42-
file: public_pages/dist/*
43-
skip_cleanup: true
44-
on:
45-
branch: master
46-
-provider: pages
39+
- provider: script
4740
skip_cleanup: true
48-
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
4941
keep_history: true
50-
local_dir: public_pages
42+
script: bash public_pages.sh
43+
on:
44+
branch: clientBuild
45+
condition: $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"*
46+
- provider: releases
47+
target_commitish : $LAST_HASH
48+
keep_history: true
49+
api_key: $GITHUB_TOKEN
50+
skip_cleanup: true
51+
overwrite: true
5152
on:
52-
branch: master
53+
branch: clientBuild
54+
condition: $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"*
5355
- provider: npm
56+
registry: "https://registry.npmjs.org/"
5457
skip_cleanup: true
58+
access: public
5559
56-
api_key: "NPM_TOKEN"
60+
api_key: $NPM_TOKEN
5761
keep_history: true
62+
auth_method: "authToken"
5863
on:
59-
branch : master
64+
branch : clientBuild
65+
condition: $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"*

Readme.md

Lines changed: 10 additions & 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

@@ -459,6 +459,9 @@ client.deleteDocument("http://localhost:6363/myFirstTerminusDB/document/chess",o
459459

460460
```
461461

462+
## Tutorials
463+
Visit [terminus-tutorials](https://github.com/terminusdb/terminus-tutorials) for tutorial scripts
464+
462465
## Testing
463466
* Clone this repository
464467

@@ -472,6 +475,12 @@ $ npm install
472475
$ npm run test
473476
```
474477

478+
## Report Issues
479+
480+
If you have encounter any issues, please report it with your os and environment setup, version that you are using and a simple reproducible case.
481+
482+
If you encounter other questions, you can ask in our community [forum](https://community.terminusdb.com/) or [Slack channel](http://bit.ly/terminusdb-slack).
483+
475484
## Contribute
476485
It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.
477486

dist/index.html

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

dist/terminus-client.min.js

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

dist/terminus-client.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/viewer/chartConfig.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ WOQLChartConfig.prototype.layout=function(layout){
104104
}
105105

106106

107-
//default is { top: 10, right: 30, left: 0, bottom: 0 }
107+
//default is { top: 10, right: 30, left: 0, bottom: 80 }
108108
WOQLChartConfig.prototype.margin=function(marginObj){
109109
if(marginObj){
110110
this._margin=marginObj;
@@ -250,13 +250,23 @@ WOQLChartRule.prototype.dot=function(isVisible){
250250
}
251251

252252
WOQLChartRule.prototype.labelRotate=function(angle){
253-
if(angle){
253+
if(angle!==undefined){
254254
this.rule.labelRotate = angle;
255255
return this
256256
}
257257
return this.rule.labelRotate;
258258
}
259259

260+
//Specify the padding of x-axis. DEFAULT: { left: 0, right: 0 }
261+
WOQLChartRule.prototype.padding=function(paddingObj){
262+
if(paddingObj){
263+
this.rule.padding=paddingObj;
264+
return this
265+
}
266+
267+
return this.rule.padding;
268+
}
269+
260270
/*
261271
* The type of xAxis or yAxis 'number' | 'category' default is 'category'.
262272
* The type of line chart 'basis'|'basisClosed'|'basisOpen'|'linear'|'linearClosed'|'natural'|'monotoneX'|'monotoneY'|'monotone' | 'step' | 'stepBefore' | 'stepAfter' |

lib/woql.js

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

242+
243+
/**
244+
* Provides details of a file source in a JSON format that includes a URL property
245+
* @param {object} url - file data source in a JSON format
246+
* @param {object} opts - imput options, optional
247+
* @return {object} WOQLQuery
248+
*/
249+
WOQL.post = function(url, opts){ return new WOQLQuery().post(url, opts); }
250+
251+
242252
/**
243253
* Create a list of variables for WOQL
244254
* @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;
@@ -1908,7 +1923,7 @@ WOQLQuery.prototype.addStart = function(s){
19081923
/**
19091924
* Executes the query using the passed client to connect to a server
19101925
*/
1911-
WOQLQuery.prototype.execute = function(client){
1926+
WOQLQuery.prototype.execute = function(client,fileList){
19121927
if(!this.query["@context"]){
19131928
this.query['@context'] = client.connection.getJSONContext();
19141929
for(var pref in UTILS.standard_urls){
@@ -1921,12 +1936,14 @@ WOQLQuery.prototype.execute = function(client){
19211936
else {
19221937
var json = this.json();
19231938
}
1939+
const opts=fileList ? {fileList:fileList} : null;
19241940
if(this.contains_update){
1925-
return client.select(false, json);
1926-
//return client.update(false, json);
1941+
//return client.select(false, json,opts);
1942+
return client.update(false, json,opts);
19271943
}
19281944
else {
1929-
return client.select(false, json);
1945+
//return client.select(false, json,opts);
1946+
return client.update(false, json,opts);
19301947
}
19311948
}
19321949

lib/woqlClient.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ WOQLClient.prototype.select = function (qurl, woql, opts) {
297297
new URIError(ErrorMessage.getInvalidURIMessage(qurl, 'Select'))
298298
);
299299
}
300-
let q = { 'terminus:query': JSON.stringify(woql) };
300+
const fileList = opts ? opts.fileList : {};
301+
let q = {'terminus:query' : JSON.stringify(woql), ...fileList};
302+
301303
q = this.addOptionsToWOQL(q, opts);
302304
return this.dispatch(this.connectionConfig.queryURL(), CONST.WOQL_SELECT, q);
303305
};
@@ -314,11 +316,14 @@ WOQLClient.prototype.select = function (qurl, woql, opts) {
314316
WOQLClient.prototype.update = function (qurl, woql, opts) {
315317
if (qurl && !this.connectionConfig.setQueryURL(qurl)) {
316318
return Promise.reject(
317-
new URIError(ErrorMessage.getInvalidURIMessage(qurl, 'Update'))
319+
new URIError(ErrorMessage.getInvalidURIMessage(qurl, 'Select'))
318320
);
319321
}
320-
woql = this.addOptionsToWOQL(woql, opts);
321-
return this.dispatch(this.connectionConfig.queryURL(), 'woql_update', woql);
322+
const fileList = opts ? opts.fileList : {};
323+
let q = {'terminus:query' : JSON.stringify(woql), ...fileList};
324+
325+
q = this.addOptionsToWOQL(q, opts);
326+
return this.dispatch(this.connectionConfig.queryURL(), CONST.WOQL_UPDATE, q);
322327
};
323328

324329
/**

0 commit comments

Comments
 (0)