Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5905159
feature-921 expose REST queries
fenglianxu Jul 10, 2017
4d0dd24
work in progress
dselman Jul 10, 2017
3b7626d
work in progress
dselman Jul 10, 2017
c6703af
working progress to add parameters in REST APIs
fenglianxu Jul 10, 2017
162bf17
Queries exposed as REST methods using query params
dselman Jul 10, 2017
7fad5ea
Merge branch 'feature-921' of https://github.com/fenglianxu/composer …
dselman Jul 10, 2017
503c3cf
wip
dselman Jul 10, 2017
a63506a
Merge branch 'master' of https://github.com/hyperledger/composer into…
fenglianxu Jul 11, 2017
aa40ddd
add MemberExpression
fenglianxu Jul 11, 2017
5ac6780
feature-921
fenglianxu Jul 18, 2017
878e748
Merge branch 'master' into feature-921
fenglianxu Jul 18, 2017
4c206a4
Merge branch 'master' of https://github.com/hyperledger/composer into…
fenglianxu Jul 18, 2017
00e4733
Merge branch 'feature-921' of https://github.com/fenglianxu/composer …
fenglianxu Jul 18, 2017
f97983b
Merge branch 'master' of https://github.com/hyperledger/composer into…
dselman Jul 18, 2017
1fb5084
unit tests for QueryAnalyzer
dselman Jul 18, 2017
1538088
Adding Unit Test for loop connector
fenglianxu Jul 19, 2017
acb5d43
wip
dselman Jul 19, 2017
8e4e3cd
wip
dselman Jul 19, 2017
4a1e341
Merge branch 'feature-921' of https://github.com/fenglianxu/composer …
dselman Jul 19, 2017
9058fa4
Fixed type conversion for query
dselman Jul 19, 2017
975f1c0
wip testing
dselman Jul 19, 2017
bdb328a
unit tests for businessnetworkconnector
dselman Jul 19, 2017
0aee48e
query docs
dselman Jul 19, 2017
72404a0
query tests
dselman Jul 19, 2017
999e444
Merge branch 'master' of https://github.com/hyperledger/composer into…
dselman Jul 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/composer-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"postlint": "npm run licchk",
"licchk": "license-check",
"postlicchk": "npm run doc",
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf"
"doc": "jsdoc --pedantic --recurse -c jsdoc.json"
},
"repository": {
"type": "git",
Expand Down
Binary file added packages/composer-cli/bond-network@0.1.1.bna
Binary file not shown.
Binary file added packages/composer-cli/trade-network@0.1.1.bna
Binary file not shown.
Binary file added packages/composer-cli/trade-network@0.1.2.bna
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/composer-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"pretest": "npm run licchk",
"licchk": "license-check",
"postlicchk": "npm run doc",
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf",
"doc": "jsdoc --pedantic --recurse -c jsdoc.json",
"postdoc": "npm run lint",
"lint": "eslint .",
"test": "node ./scripts/api-changelog.js && nyc mocha --recursive -t 10000"
Expand Down
1 change: 1 addition & 0 deletions packages/composer-common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports.OrderBy = require('./lib/query/orderby');
module.exports.ParticipantDeclaration = require('./lib/introspect/participantdeclaration');
module.exports.Property = require('./lib/introspect/property');
module.exports.Query = require('./lib/query/query');
module.exports.QueryAnalyzer = require('./lib/query/queryanalyzer.js');
module.exports.QueryFile = require('./lib/query/queryfile');
module.exports.QueryManager = require('./lib/querymanager');
module.exports.Relationship = require('./lib/model/relationship');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,36 @@ class LoopbackVisitor {

}

/**
* Given a primitive Composer type returns the corresponding loopback type
* @param {string} type - the composer primitive type name
* @return {string} the loopback type
* @private
*/
static toLoopbackType(type) {

let result = 'string';

switch (type) {
case 'String':
result = 'string';
break;
case 'Double':
case 'Integer':
case 'Long':
result= 'number';
break;
case 'DateTime':
result = 'date';
break;
case 'Boolean':
result = 'boolean';
break;
}

return result;
}

/**
* Visitor design pattern
* @param {Field} field - the object being visited
Expand All @@ -404,22 +434,7 @@ class LoopbackVisitor {

// Render the type as JSON Schema.
jsonSchema = {};
switch (field.getType()) {
case 'String':
jsonSchema.type = 'string';
break;
case 'Double':
case 'Integer':
case 'Long':
jsonSchema.type = 'number';
break;
case 'DateTime':
jsonSchema.type = 'date';
break;
case 'Boolean':
jsonSchema.type = 'boolean';
break;
}
jsonSchema.type = LoopbackVisitor.toLoopbackType(field.getType());

// If this field has a default value, add it.
if (field.getDefaultValue()) {
Expand Down
1 change: 0 additions & 1 deletion packages/composer-common/lib/query/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class Query {
getSelect() {
return this.select;
}

}

module.exports = Query;
Loading