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
9f5d80c
Add WebSQL adapter to handle Safari (#1484)
Jul 6, 2017
ad0bf8c
Command changes ed (#1483)
EdProsser Jul 6, 2017
e3223a7
Automatic version bump to 0.9.2
fabric-composer-app Jul 6, 2017
355813f
homepage fixes (#1496)
Tobias-Hunter Jul 6, 2017
5f4be04
Added footer to playground (#1478)
Jul 6, 2017
3276c4b
Improve wallet service test coverage (#1506)
jt-nti Jul 6, 2017
e35215b
Tests updated to get the code coverage; and defects fixed that it fou…
mbwhite Jul 6, 2017
d66eb3f
Complete PersistentModel API tests (resolves #930) (#1511)
Jul 7, 2017
50ec18b
composer-common/lib/introspect unit tests (#1507)
Jul 7, 2017
5f64b6e
Event validation (#1508)
Jul 7, 2017
0ef0019
PR for #796 (#1434)
bestbeforetoday Jul 7, 2017
c062da7
Added svg transformation when showing event (#1512)
Jul 10, 2017
e646684
Changed Github to GitHub (#1520)
Jul 10, 2017
f11dc85
Issue 1332 - Enable query support in playground. (#1519)
KaiUsher Jul 10, 2017
6bad181
Only deploy for tagged/release builds and the master branch (#1523)
Jul 10, 2017
021f6a5
Enable complex queries against nested properties (#1524)
Jul 10, 2017
34d7c0d
update validation notes for query (#1528)
KaiUsher Jul 11, 2017
71d0174
Styling changes to README & typography fixes (#1532)
Tobias-Hunter Jul 11, 2017
a46e0ef
Move to Hyperledger Fabric v1.0.0 (npm dependencies, system tests) (#…
Jul 11, 2017
d67d159
Remove double scroll bar (#1527)
Jul 12, 2017
f147555
Fix ability to issue identity to none existent participant (#1526)
Jul 12, 2017
49045b7
Prevent identifying fields in transaction and event model (#1517) (#1…
Jul 12, 2017
a0293ca
Updated tutorial guide, minor fixes to cmdline , package.json instruc…
Jul 12, 2017
344eff5
Use workaround for jekyll issue #6221 (#1551)
Jul 13, 2017
1574185
Merge PRs 1548 + 1550, pull e2e tests out into separate build (#1552)
Jul 13, 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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ matrix:
- env: SYSTEST=embedded,proxy,web FC_TASK=systest
- env: SYSTEST=hlf FC_TASK=systest
- env: SYSTEST=hlfv1_tls FC_TASK=systest
# - env: SYSTEST=e2e FC_TASK=systest
dist: trusty
addons:
apt:
Expand Down
4 changes: 2 additions & 2 deletions .travis/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ then
if [ "${FC_TASK}" != "docs" ]; then
# echo "ABORT_BUILD=true" > ${DIR}/build.cfg
# echo "ABORT_CODE=0" >> ${DIR}/build.cfg
echo 'Docs only build - no pointing bothering with anything more'
exit 0
echo 'Docs only build'
# exit 0
fi

else
Expand Down
6 changes: 6 additions & 0 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ if [[ "${TRAVIS_REPO_SLUG}" != hyperledger* ]]; then
exit 0
fi

# Check that if this is not a tagged build, then we only deploy master.
if [ "${TRAVIS_TAG}" = "" -a "${TRAVIS_BRANCH}" != "master" ]; then
echo Not executing as not building a tag and not building from master
exit 0
fi

# are we building the docs?
if [ "${DOCS}" != "" ]; then
if [ -z "${TRAVIS_TAG}" ]; then
Expand Down
6 changes: 6 additions & 0 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ if [ "${DOCS}" != "" ]; then
npm run linkcheck:unstable
fi

# Are we running playground e2e tests?
elif [ "${SYSTEST}" = "e2e" ]; then

# Run the playground e2e tests.
cd "${DIR}/packages/composer-playground"
npm run e2e:main

# Are we running system tests?
elif [ "${SYSTEST}" != "" ]; then
Expand Down
8 changes: 7 additions & 1 deletion contrib-notes/release-process/playground-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ Start with the basic sample network loaded
- Import/replace button should bring up the Import/replace modal
- Should have access to all samples
- All samples should import

- Add file button should bring up add file modal
- Should be able to add query file from disk

### Define Page (File-Editor)
This page is the main file editor page, where it is possible to edit resources. We need to ensure that the linking between the side navigation menu and the file editor is consistent, that validation errors report correctly for each file type and that file specific edit options are enabled.

Expand Down Expand Up @@ -115,6 +117,10 @@ Select ACL file
- Reverse change to resource field
- Error message should disappear

Add a query file - a dummy file can be found at composer/packages/composer-playground/e2e/data/files/importQuery.qry
- It should become the focal item and contents should show in the editor
- Edit the file to cause a breakage, it should show an error message under the editor. Repair the file and the error message should disappear.

Select the main model file and delete it
- Deploy button should not be active
- ACL file navigation menu should be shown in error (via red indicators)
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"packages": [
"packages/*"
],
"version": "0.9.1",
"version": "0.9.2",
"hoist": true
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"name": "composer",
"description": "You must install [Lerna](https://lernajs.io) to build this multi-package repository.",
"version": "0.9.1",
"version": "0.9.2",
"main": "index.js",
"private": true,
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions packages/composer-admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "composer-admin",
"version": "0.9.1",
"version": "0.9.2",
"description": "Hyperledger Composer Admin, code that manages business networks deployed to Hyperledger Fabric",
"engines": {
"node": ">=6",
Expand Down Expand Up @@ -42,9 +42,9 @@
"sinon-as-promised": "^4.0.2"
},
"dependencies": {
"composer-common": "^0.9.1",
"composer-connector-hlf": "^0.9.1",
"composer-connector-hlfv1": "^0.9.1"
"composer-common": "^0.9.2",
"composer-connector-hlf": "^0.9.2",
"composer-connector-hlfv1": "^0.9.2"
},
"license-check-config": {
"src": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ asset Business identified by sbi {
/**
* An abstract transaction type for animal movements
*/
abstract transaction AnimalMovement identified by transactionId {
abstract transaction AnimalMovement {
o String transactionId
o String[] logs optional
--> Animal animal
Expand Down
10 changes: 5 additions & 5 deletions packages/composer-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "composer-cli",
"version": "0.9.1",
"version": "0.9.2",
"description": "Hyperledger Composer command line interfaces (CLIs)",
"engines": {
"node": ">=6",
Expand Down Expand Up @@ -42,10 +42,10 @@
"dependencies": {
"chalk": "^1.1.3",
"cli-table": "^0.3.1",
"composer-admin": "^0.9.1",
"composer-client": "^0.9.1",
"composer-common": "^0.9.1",
"composer-rest-server": "^0.9.1",
"composer-admin": "^0.9.2",
"composer-client": "^0.9.2",
"composer-common": "^0.9.2",
"composer-rest-server": "^0.9.2",
"homedir": "^0.6.0",
"npm-paths": "^0.1.3",
"nunjucks": "^3.0.0",
Expand Down
19 changes: 18 additions & 1 deletion packages/composer-client/lib/businessnetworkconnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,30 @@ class BusinessNetworkConnection extends EventEmitter {
throw new Error('userID not specified');
}
let participantFQI;
let participantId;
let participantType;
if (participant instanceof Resource) {
participantFQI = participant.getFullyQualifiedIdentifier();
participantId = participant.getIdentifier();
participantType = participant.getFullyQualifiedType();
} else {
participantFQI = participant;
participantId = participantFQI.substring(participantFQI.lastIndexOf('#') + 1);
participantType = participantFQI.substr(0, participantFQI.lastIndexOf('#'));
}

Util.securityCheck(this.securityContext);
return this.connection.createIdentity(this.securityContext, userID, options)
return this.getParticipantRegistry(participantType)
.then((participantRegistry) => {
return participantRegistry.exists(participantId);
})
.then((exists) => {
if (exists) {
return this.connection.createIdentity(this.securityContext, userID, options);
} else {
throw new Error(`Participant '${participantFQI}' does not exist `);
}
})
.then((identity) => {
return Util.invokeChainCode(this.securityContext, 'addParticipantIdentity', [participantFQI, userID])
.then(() => {
Expand Down
8 changes: 4 additions & 4 deletions packages/composer-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "composer-client",
"version": "0.9.1",
"version": "0.9.2",
"description": "The node.js client library for Hyperledger Composer, a development framework for Hyperledger Fabric",
"engines": {
"node": ">=6",
Expand Down Expand Up @@ -42,9 +42,9 @@
"logError": true
},
"dependencies": {
"composer-common": "^0.9.1",
"composer-connector-hlf": "^0.9.1",
"composer-connector-hlfv1": "^0.9.1",
"composer-common": "^0.9.2",
"composer-connector-hlf": "^0.9.2",
"composer-connector-hlfv1": "^0.9.2",
"uuid": "^3.0.1"
},
"devDependencies": {
Expand Down
16 changes: 16 additions & 0 deletions packages/composer-client/test/businessnetworkconnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('BusinessNetworkConnection', () => {
let mockQueryFile;
let mockFactory;
let mockSerializer;
let mockParticipantRegistry;

beforeEach(() => {
sandbox = sinon.sandbox.create();
Expand All @@ -74,6 +75,7 @@ describe('BusinessNetworkConnection', () => {
mockSerializer = sinon.createStubInstance(Serializer);
businessNetworkConnection.businessNetwork.getSerializer.returns(mockSerializer);
businessNetworkConnection.securityContext = mockSecurityContext;
mockParticipantRegistry = sinon.createStubInstance(ParticipantRegistry);
delete process.env.COMPOSER_CONFIG;
});

Expand Down Expand Up @@ -868,6 +870,11 @@ describe('BusinessNetworkConnection', () => {
userID: 'dogeid1',
userSecret: 'suchsecret'
});

mockParticipantRegistry.exists.resolves(true);
businessNetworkConnection.getParticipantRegistry = () => {
return Promise.resolve(mockParticipantRegistry);
};
});

it('should throw if participant not specified', () => {
Expand Down Expand Up @@ -931,6 +938,15 @@ describe('BusinessNetworkConnection', () => {
});
});

it('should throw if participant does not exist', () => {
sandbox.stub(Util, 'invokeChainCode').resolves();
mockParticipantRegistry.exists.resolves(false);

return businessNetworkConnection.issueIdentity('org.doge.Doge#DOGE_1', 'dogeid1')
.catch((error) => {
error.should.match(/does not exist /);
});
});
});

describe('#revokeIdentity', () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/composer-common/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class BusinessNetworkMetadata {
}
class Factory {
+ void constructor(ModelManager)
+ Resource newResource(string,string,string,Object,boolean,string) throws TypeNotFoundException
+ Resource newConcept(string,string,Object,boolean,string) throws TypeNotFoundException
+ Resource newResource(string,string,string,Object,boolean,string,boolean) throws TypeNotFoundException
+ Resource newConcept(string,string,Object,boolean,string,boolean) throws TypeNotFoundException
+ Relationship newRelationship(string,string,string) throws TypeNotFoundException
+ Resource newTransaction(string,string,string,Object,string)
+ Resource newEvent(string,string,string,Object,string)
+ Resource newTransaction(string,string,string,Object,string,boolean)
+ Resource newEvent(string,string,string,Object,string,boolean)
}
class FileWallet extends Wallet {
+ string getHomeDirectory()
Expand Down
2 changes: 2 additions & 0 deletions packages/composer-common/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#
# Note that the latest public API is documented using JSDocs and is available in api.txt.
#
Version 0.9.2 {60327250ee4f059647020f8aee5ed67b} 2017-07-06
- Added includeOptionalFields option to Factory.newXXX functions

Version 0.9.0 {d0b9ae5179276e20604874624fe9529d} 2017-06-23
- Removed useless toJSON methods everywhere
Expand Down
2 changes: 1 addition & 1 deletion packages/composer-common/lib/businessnetworkdefinition.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ class BusinessNetworkDefinition {
}
}

// grab the query.qry
// grab the queries.qry
const queryPath = fsPath.resolve(path, 'queries.qry');
if(fs.existsSync(queryPath)) {
let queryContents = fs.readFileSync( queryPath, ENCODING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class LoopbackVisitor {

// Add information from the class declaration into the composer section.
if (jsonSchema.options && jsonSchema.options.composer) {
jsonSchema.options.composer.namespace = classDeclaration.getModelFile().getNamespace();
jsonSchema.options.composer.namespace = classDeclaration.getNamespace();
jsonSchema.options.composer.name = classDeclaration.getName();
jsonSchema.options.composer.fqn = classDeclaration.getFullyQualifiedName();
}
Expand Down
Loading