Skip to content

Commit

Permalink
fixed #6
Browse files Browse the repository at this point in the history
superagent dependency set to 0.17.0
  • Loading branch information
agea committed Jun 17, 2014
1 parent 60a7d86 commit 0968f33
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ A CMIS javascript library for node and browser

### browser

You can download minified version (with dependencies) from https://github.com/agea/CmisJS/releases/download/v0.1.1/cmis.0.1.1.min-all.js
You can download minified version (with dependencies) from https://github.com/agea/CmisJS/releases/download/v0.1.1/cmis.0.1.6.min-all.js

<script type="text/javascript" src="cmis-0.1.1.min-all.js"></script>
<script type="text/javascript" src="cmis-0.1.6.min-all.js"></script>

*Note:*
You have to include [superagent](http://visionmedia.github.io/) if you want to use [cmis-0.1.1.js](https://github.com/agea/CmisJS/releases/download/v0.1.1/cmis.0.1.1.js) or [cmis-0.1.1.min.js](https://github.com/agea/CmisJS/releases/download/v0.1.1/cmis.0.1.1.min.js)
You have to include [superagent](http://visionmedia.github.io/) if you want to use [cmis-0.1.6.js](https://github.com/agea/CmisJS/releases/download/v0.1.1/cmis.0.1.1.js) or [cmis-0.1.6.min.js](https://github.com/agea/CmisJS/releases/download/v0.1.1/cmis.0.1.6.min.js)

## Usage

Expand Down Expand Up @@ -55,20 +55,20 @@ Install grunt:
Clone the repo:

$ git clone https://github.com/agea/CmisJS/

Install dependencies:

$ cd CmisJS

$ npm install

### Running tests on node

(http://cmis.alfresco.com will be used as test repository)

$ grunt test

You can specify different url, username and password
You can specify different url, username and password

$ grunt test --url http://localhost:8080/alfresco/cmisbrowser --user admin --password secret

Expand All @@ -89,4 +89,3 @@ To change username and password you can specify them in the url
##License

MIT license - [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)

7 changes: 3 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "cmis",
"version": "0.1.5",
"version": "0.1.6",
"dependencies": {
"superagent":""
"superagent":"~0.17.0"
},
"devDependencies": {

}
}

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "CmisJS",
"name": "cmis",
"version": "0.1.5",
"version": "0.1.6",
"homepage": "http://github.com/agea/CmisJS",
"description": "a CMIS client library written in Javascript for node and the browser",
"author": {
Expand All @@ -14,7 +14,7 @@
"url": "git://github.com/agea/cmisjs.git"
},
"dependencies": {
"superagent": ""
"superagent": "~0.17.0"
},
"devDependencies": {
"grunt-cli": "",
Expand Down
28 changes: 14 additions & 14 deletions test/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ session.setGlobalHandlers(console.log, console.log);
var rootId;

describe('CmisJS library test', function () {

it('should connect to a repository', function (done) {
session.setCredentials(username, password).loadRepositories()
.ok(function (data) {
Expand Down Expand Up @@ -123,7 +123,7 @@ describe('CmisJS library test', function () {
queryName:'test:testDoc',
fileable:true,
includedInSupertypeQuery:true,
creatable:true,
creatable:true,
fulltextIndexed:false,
queryable:false,
controllableACL:true,
Expand All @@ -144,7 +144,7 @@ describe('CmisJS library test', function () {
cardinality:'single',
queryable:true,
orderable:true,
}
}
}
}

Expand Down Expand Up @@ -267,7 +267,7 @@ describe('CmisJS library test', function () {
it('should return folder parent', function (done) {
session.getFolderParent(randomFolderId).ok(function (data) {
assert(
data.succinctProperties['cmis:objectId']==rootId,
data.succinctProperties['cmis:objectId']==rootId,
"should return root folder");
done();
});
Expand All @@ -276,7 +276,7 @@ describe('CmisJS library test', function () {
it('should return object parents', function (done) {
session.getParents(randomFolderId).ok(function (data) {
assert(
data[0].object.succinctProperties['cmis:objectId']==rootId,
data[0].object.succinctProperties['cmis:objectId']==rootId,
"should return root folder");
done();
});
Expand All @@ -285,7 +285,7 @@ describe('CmisJS library test', function () {
it('should return allowable actions', function (done) {
session.getAllowableActions(randomFolderId).ok(function (data) {
assert(
data.canCreateDocument!==undefined,
data.canCreateDocument!==undefined,
"create document action should be defined");
done();
});
Expand All @@ -294,7 +294,7 @@ describe('CmisJS library test', function () {
it('should return object properties', function (done) {
session.getProperties(randomFolderId).ok(function (data) {
assert(
data['cmis:name']==randomFolder,
data['cmis:name']==randomFolder,
"folder name should be " + randomFolder);
done();
});
Expand All @@ -304,34 +304,34 @@ describe('CmisJS library test', function () {
session.updateProperties(firstChildId,
{'cmis:name':'First Level Renamed'}).ok(function (data) {
assert(
data.succinctProperties['cmis:name']=='First Level Renamed',
data.succinctProperties['cmis:name']=='First Level Renamed',
"folder name should be 'First Level Renamed'");
done();
});
});
});

it('should move specified object', function (done) {
session.moveObject(secondChildId, firstChildId, randomFolderId).ok(function (data) {
assert(data.succinctProperties['cmis:parentId']==randomFolderId,
"Parent folder id should be " + randomFolderId);
done();
});
});
});

var docId
var txt = 'this is the document content';
it('should create a document', function (done) {
var aces = {}
aces[username] = ['cmis:read'];
session.createDocument(randomFolderId, txt, 'test.txt',
session.createDocument(randomFolderId, txt, 'test.txt',
'text/plain', undefined, undefined, aces).ok(function (data) {
docId = data.succinctProperties['cmis:objectId'];
done();
});
});

it('should update properties of documents', function (done) {
session.bulkUpdateProperties([docId],
session.bulkUpdateProperties([docId],
{'cmis:name':'mod-test.txt'}).ok(function (data) {
assert(data,'OK');
done();
Expand Down Expand Up @@ -404,7 +404,7 @@ describe('CmisJS library test', function () {
done();
return;
}
session.checkIn(checkOutId, true, 'test-checkedin.txt',
session.checkIn(checkOutId, true, 'test-checkedin.txt',
txt, 'the comment!').ok(function (data) {
docId = data.succinctProperties['cmis:objectId'].split(";")[0];
done();
Expand Down Expand Up @@ -439,7 +439,7 @@ describe('CmisJS library test', function () {
if (!appended){
console.log("skipping")
done();
return;
return;
}
session.getContentStream(docId).ok(function (data) {
assert(data == txt+appended,'document content should be "' + txt + appended + '"');
Expand Down

0 comments on commit 0968f33

Please sign in to comment.